/* ============================================================
   DEMO PRINT CARDS
   ============================================================ */

.demo-card {
  font-size: 0.85rem;
  border: 2px solid #333;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.demo-faction-header {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-faction-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-total-pts {
  font-size: 0.8rem;
  opacity: 0.75;
}

/* ---------- Unit Block ---------- */
.unit-block {
  border-top: 1px solid #ccc;
  break-inside: avoid;
  page-break-inside: avoid;
  display: grid;
  grid-template-columns: auto 1fr;
}

.unit-head {
  background: #f0ece5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-bottom: 1px solid #ccc;
  grid-column: 1 / -1;
  grid-row: 1;
}

.unit-name-text {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1;
}

.unit-class-badge {
  font-size: 0.72rem;
  color: #666;
  font-style: italic;
}

.unit-cost-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: #333;
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
}

/* ---------- SPECIAL Stats ---------- */
.special-row {
  display: flex;
  align-items: stretch;
  padding: 0.3rem 0.6rem;
  gap: 3px;
  background: #fff;
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid #ddd;
  border-bottom: none;
  align-self: start;
}

.special-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #999;
  padding: 2px 4px;
  min-width: 28px;
}

.special-stat .s-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: #666;
  line-height: 1;
  text-transform: uppercase;
}

.special-stat .s-value {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
}

.health-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  margin-left: 4px;
  gap: 1px;
}

.health-track .s-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: #666;
}

.health-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  max-width: 52px;
}

.h-dot {
  width: 11px;
  height: 11px;
  border: 1.5px solid #333;
  border-radius: 50%;
  background: transparent;
}

/* ---------- Perks row ---------- */
.unit-perks-row {
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  color: #444;
  border-top: 1px solid #eee;
  border-bottom: none;
  border-right: 1px solid #ddd;
  background: #fafafa;
  grid-column: 1;
  grid-row: 3;
  align-self: start;
}

.unit-perks-row strong {
  color: #222;
  font-size: 0.72rem;
}

/* ---------- Weapon Table ---------- */
.weapon-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: start;
}

.weapon-tbl th {
  background: #e8e4dc;
  padding: 2px 6px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #444;
  border-bottom: 1px solid #bbb;
}

.weapon-tbl td {
  padding: 2px 6px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.weapon-tbl tr:last-child td {
  border-bottom: none;
}

/* ---------- Reference Table ---------- */
.ref-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  margin-top: 1rem;
  border: 1px solid #ccc;
}

.ref-tbl td {
  padding: 2px 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  line-height: 1.35;
}

.ref-tbl td:first-child {
  font-weight: 700;
  white-space: nowrap;
  padding-right: 6px;
  min-width: 110px;
}

.ref-divider td {
  background: #2a2a2a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 6px;
}

.ref-tbl td.ref-src {
  font-size: 0.62rem;
  color: #bbb;
  white-space: nowrap;
  padding-left: 6px;
}

/* ---------- Page Break ---------- */
.page-break {
  break-before: page;
  page-break-before: always;
}

/* ---------- Side B Quick Rules ---------- */
.rules-page-header {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 4px 4px 0 0;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.rules-box {
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.72rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.rules-box h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.2rem 0;
  padding-bottom: 2px;
  border-bottom: 1.5px solid #333;
  color: #1a1a1a;
}

.rules-box p {
  margin: 0.1rem 0;
  font-size: 0.72rem;
  line-height: 1.3;
}

.rules-box ul,
.rules-box ol {
  margin: 0.1rem 0;
  padding-left: 0.0rem;
  font-size: 0.72rem;
}

.rules-box li {
  margin-bottom: 1px;
  line-height: 1.3;
}

.action-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.action-tbl td {
  padding: 1px 4px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  line-height: 1.3;
}

.action-tbl td:first-child {
  font-weight: 700;
  white-space: nowrap;
  padding-right: 6px;
  min-width: 90px;
}

.action-restriction {
  font-size: 0.65rem;
  color: #888;
  display: inline;
}

.action-section td {
  background: #e8e4dc;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 4px;
  color: #444;
  border-bottom: 1px solid #ccc;
}

.damage-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.damage-tbl th {
  background: #eee;
  padding: 2px 6px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.damage-tbl td {
  padding: 2px 6px;
  border-bottom: 1px solid #eee;
}

/* ---------- Print ---------- */
@page {
  margin: 0.5cm;
}

@media print {
  .md-header,
  .md-tabs,
  [data-md-component="sidebar"],
  .md-sidebar,
  .md-footer,
  .md-top,
  [data-md-component="toc"],
  .md-nav,
  .md-content__button {
    display: none !important;
  }

  .md-main {
    padding-top: 0 !important;
  }

  .md-main__inner {
    margin: 0 !important;
  }

  .md-content {
    max-width: 100% !important;
  }

  .md-content__inner {
    margin: 0 !important;
    padding: 0 !important;
  }

  h1:first-child {
    display: none;
  }

  .page-break {
    break-before: page;
    page-break-before: always;
    height: 0;
    margin: 0;
    padding: 0;
  }

  .unit-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .rules-box {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a[href]::after {
    content: none !important;
  }

  body {
    font-size: 10pt;
  }
}
