*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1a2e4a;
  --blue:        #2c5282;
  --gold:        #b7862a;
  --rule:        #c8d4e3;
  --bg:          #f7f8fa;
  --note-bg:     #fff8e6;
  --note-border: #d4a017;
  --group-bg:    #e8eef7;
  --row-alt:     #f0f4fa;
  --font-sans:   Calibri, 'Gill Sans', 'Gill Sans MT', Optima, Arial, Helvetica, sans-serif;
  --font-serif:  Georgia, 'Times New Roman', Times, serif;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: #000;
  background: var(--bg);
  padding: 28px 32px 48px;
  max-width: 960px;
  margin: 0 auto;
}

/* ── Screen-only running header placeholder ── */
.print-running-header { display: none; }

/* ── Page header ── */
header {
  border-bottom: 3px solid var(--navy);
  padding-bottom: 14px;
  margin-bottom: 22px;
}

header h1 {
  font-family: var(--font-serif);
  font-size: 1.45em;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
}

header .subtitle {
  font-size: 1.05em;
  color: var(--blue);
  font-weight: 600;
  margin-top: 2px;
}

header .meta {
  font-size: 0.85em;
  color: #444;
  margin-top: 6px;
  font-style: italic;
}

/* ── Legal warning box (red border) ── */
.legal-warning {
  border: 2px solid #cc0000;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 0.9em;
  line-height: 1.55;
  page-break-inside: avoid;
  break-inside: avoid;
}

.legal-warning p + p { margin-top: 7px; }

/* ── Section group heading ── */
.group-heading {
  background: var(--group-bg);
  border-left: 5px solid var(--blue);
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.95em;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 28px 0 0;
  page-break-after: avoid;
}

/* ── Main vocabulary table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

col.col-en  { width: 45%; }
col.col-es  { width: 45%; }
col.col-def { width: 10%; }

thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 7px 10px;
  text-align: left;
  border: 1px solid #000;
}

tbody tr:nth-child(even) td { background: var(--row-alt); }
tbody tr:nth-child(odd)  td { background: #fff; }

tbody tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

tbody tr:first-child {
  page-break-before: avoid;
  break-before: avoid;
}

tbody tr.first-in-group td { border-top: 2px solid #000; }

td {
  padding: 8px 10px;
  border-top:    1px solid var(--rule);
  border-left:   1px solid var(--rule);
  border-right:  1px solid var(--rule);
  border-bottom: 1px solid #000;
  vertical-align: top;
  line-height: 1.5;
}

td.en { font-weight: 600; }
td.es { font-weight: 600; font-style: italic; }

.def-en {
  display: block;
  margin-bottom: 4px;
  font-weight: normal;
  font-style: normal;
}

.def-es {
  display: block;
  font-weight: normal;
  font-style: normal;
}

/* Item reference badge */
.item-ref {
  display: inline-block;
  background: var(--group-bg);
  border: 1px solid #888;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: 700;
  padding: 1px 5px;
  margin-bottom: 3px;
  letter-spacing: 0.02em;
}

/* TTS button for vocabulary keywords */
.tts-kw {
  background: none;
  border: none;
  padding: 0 4px 0 0;
  font-size: 1rem;
  cursor: pointer;
  color: var(--navy);
  vertical-align: middle;
  line-height: 1;
}
.tts-kw:hover { color: var(--blue); }

/* Advocate special note */
.advocate-note {
  display: block;
  margin-top: 5px;
  padding: 5px 8px;
  background: #fff3cd;
  border-left: 3px solid var(--gold);
  font-size: 0.85em;
  font-style: normal;
}

/* ── Print styles ── */
@media print {
  @page { margin-top: 22mm; margin-bottom: 14mm; margin-left: 14mm; margin-right: 14mm; }

  body {
    background: #fff;
    padding: 0;
    font-size: 11px;
    max-width: 100%;
  }

  .print-running-header {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1.5px solid #000;
    padding: 3px 0 4px;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tts-kw { display: none; }

  header { page-break-after: avoid; }

  .legal-warning { page-break-inside: avoid; break-inside: avoid; }

  thead th,
  .group-heading,
  tbody tr:nth-child(even) td,
  .item-ref {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  tbody tr { page-break-inside: avoid; break-inside: avoid; }
  tbody tr:first-child { page-break-before: avoid; break-before: avoid; }
}
