/* Identidad Epistema: base en negro y grises; color sólo para orientar (una tonalidad por ponencia). */
:root {
  --bg: #f6f6f4; --card: #fff; --ink: #1f1f1e; --muted: #75756f; --soft: #a3a39d; --line: #e6e5e1;
  --brand: #222; --event: #17617c; --focus: #378ADD;
  --ok: #0F6E56; --okbg: #E1F5EE; --warn: #854F0B; --warnbg: #FAEEDA; --bad: #A32D2D; --badbg: #FCEBEB;
  --c: #888780; --l: #B4B2A9; --t: #444441;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: 40px; }
[hidden] { display: none !important; }
.ico { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.16em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Encabezado */
.top { background: #fff; border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.logos { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 0 auto; padding: 10px 16px; }
.logo-ev { height: 44px; width: auto; max-width: 62%; object-fit: contain; }
.marca { display: grid; justify-items: end; line-height: 1.15; }
.puntos { display: flex; gap: 3px; align-items: center; margin-bottom: 3px; }
.puntos i { width: 5px; height: 5px; border-radius: 50%; background: #9a9a96; }
.puntos i:nth-child(2) { width: 8px; height: 8px; background: #222; }
.wordmark { font-size: 12px; letter-spacing: .28em; margin-right: -.28em; color: #333; }
.app-name { font-size: 11px; color: var(--muted); }
.who { max-width: 760px; margin: 0 auto; padding: 8px 16px; font-size: 15px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.who:empty { display: none; }
.who b { font-weight: 600; }
.who span { font-size: 12px; color: var(--muted); }
.top:has(.who:not(:empty)) .logos { border-bottom: 1px solid var(--line); }

/* Estado de guardado */
.estado { position: sticky; top: 0; z-index: 5; padding: 8px 16px; font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.estado:empty { display: none; }
.estado .ico { width: 18px; height: 18px; }
.estado.ok { background: var(--okbg); color: var(--ok); }
.estado.warn { background: var(--warnbg); color: var(--warn); }
.estado.bad { background: var(--badbg); color: var(--bad); }

main, section { max-width: 760px; margin: 0 auto; }
section { padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 16px; }
main > section.card { margin: 14px 16px; }
@media (min-width: 792px) { main > section.card { margin: 14px auto; } }
.lbl { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin: 4px 0 8px; }
select, input, textarea { width: 100%; font: inherit; color: inherit; border: 1px solid #d8d8d4; border-radius: 10px; padding: 10px 12px; background: #fff; }
textarea { min-height: 130px; resize: vertical; margin-top: 12px; font-size: 17px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--focus); border-color: transparent; }
select#mesa { margin-bottom: 10px; }

/* Mesa actual */
.mesainfo { display: grid; gap: 1px; margin: 0 0 14px; }
.kick { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mesainfo b, .gmesa-h b { font-size: 16px; font-weight: 600; }
.lugar { font-size: 12.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; }

/* Etiquetas de ponencia (color propio de cada una) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--l); background: #fff; color: var(--t);
  border-radius: 999px; padding: 6px 12px 6px 8px; font: inherit; font-size: 13.5px; cursor: pointer; }
.chip b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; }
.chip b .ico { width: 13px; height: 13px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.chip.on { background: var(--bg); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); font-weight: 600; }
.chip:disabled { border-color: var(--line); color: var(--soft); cursor: default; }
.ponsel { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--c); background: var(--bg); color: var(--t); font-size: 13.5px; }
.ponsel b, .ponsel i { display: block; }
.ponsel i { font-size: 12.5px; opacity: .85; }

.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; gap: 8px; align-items: center; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid #c9c9c4; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.listhead h2 { font-size: 18px; margin: 8px 0; }

/* Lista de notas agrupada por mesa y ponencia */
.notas { list-style: none; padding: 0; margin: 6px 0 0; }
.gmesa-h { display: grid; gap: 1px; margin: 22px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.gmesa-h:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.gponencia { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 8px; color: var(--t); }
.gponencia b, .gponencia i { display: block; }
.gponencia b { font-size: 14.5px; font-weight: 600; }
.gponencia i { font-size: 12.5px; color: var(--muted); }
.num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.num .ico { width: 14px; height: 14px; }
.nota + .gponencia { margin-top: 22px; position: relative; }
.nota + .gponencia::after { content: "· • ·"; position: absolute; top: -20px; left: 0; right: 0; text-align: center; color: #c4c4c0; letter-spacing: .5em; font-size: 12px; }
.nota { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--l); border-radius: 0; padding: 9px 11px; margin: 0 0 8px 34px; cursor: pointer; }
.nota.editando { cursor: default; border: 1.5px solid var(--c); border-radius: 10px; }
.nota textarea.edit { min-height: 100px; margin-top: 8px; font-size: 16px; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); align-items: flex-start; }
.meta > span:first-child { display: inline-flex; gap: 4px; align-items: center; }
.stcol { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.st { font-weight: 600; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.st.ok { color: var(--ok); }
.st.pend { color: var(--warn); }
.toque { font-size: 11px; color: var(--soft); display: inline-flex; gap: 3px; align-items: center; }
.txt { white-space: pre-wrap; margin-top: 4px; overflow-wrap: anywhere; }
.vacio { color: var(--muted); padding: 10px 0; }

/* Pie */
.pie { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 34px 16px 0; color: var(--muted); font-size: 12px; text-align: center; }
.pie img { height: 96px; width: auto; display: block; }
.pie .copy { font-size: 11px; margin-top: 2px; }

/* PDF (impresión): sólo se imprime #print; colores por ponencia como en pantalla */
#print { display: none; }
@media print {
  @page { size: A4; margin: 16mm 15mm 18mm; }
  body { background: #fff; padding: 0; font-size: 11pt; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #1f1f1e; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid #222; padding-bottom: 8px; }
  .doc-head img.ev { height: 15mm; }
  .doc-head img.ep { height: 13mm; }
  .doc-tipo { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .14em; color: #75756f; margin-top: 10px; }
  .doc-title { font-size: 17pt; font-weight: 600; margin: 2px 0 2px; line-height: 1.2; }
  .doc-sub { color: #75756f; font-size: 9.5pt; margin-bottom: 4px; }
  .doc-para { margin: 10px 0 4px; font-size: 11pt; }
  .doc-mesa { margin-top: 18px; padding-top: 10px; border-top: 1px solid #e6e5e1; }
  .doc-mesa .doc-title { font-size: 13.5pt; }
  .pon { margin-top: 14px; break-inside: avoid-page; }
  .pon h2 { font-size: 12pt; font-weight: 600; margin: 0 0 1px; color: var(--t); }
  .pon .pt { font-style: italic; color: #75756f; font-size: 9.5pt; margin-bottom: 6px; }
  .pn { border-left: 3px solid var(--l); padding: 2px 0 2px 10px; margin: 6px 0; break-inside: avoid; white-space: pre-wrap; }
  .pn .h { font-size: 8.5pt; color: #75756f; }
  .doc-pie { margin-top: 24px; border-top: 1px solid #d8d8d4; padding-top: 6px; font-size: 8pt; color: #75756f; display: flex; justify-content: space-between; gap: 10px; }
}
