:root {
  --teal: #1a9490;
  --teal-dark: #147f7a;
  --ink: #1f2d3d;
  --muted: #5b6b76;
  --line: #cdd9e1;
  --soft: #f3f8fa;
}

* { box-sizing: border-box; }

body.cred {
  margin: 0;
  background: #eef3f6;
  color: var(--ink);
  font: 15px/1.55 Arial, Helvetica, sans-serif;
}

/* Toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(18, 48, 62, 0.08);
}
.toolbar strong { font-size: 0.95rem; }
.toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e3943;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }

/* Document shell */
.doc {
  max-width: 1000px;
  margin: 1.2rem auto 3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15, 44, 58, 0.10);
  overflow: hidden;
}
.dochead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.dochead img { height: 38px; }
.dochead .addr { font-size: 0.72rem; color: var(--muted); text-align: right; line-height: 1.4; }
.doctitle {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin: 1.3rem 1.5rem 0.4rem;
}

/* Sections */
.section { margin-top: 1.5rem; }
.section > h2 {
  margin: 0;
  background: var(--teal);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
}
.section .body { padding: 1rem 1.5rem 1.2rem; }
.body h3 { font-size: 0.95rem; margin: 1rem 0 0.25rem; }
.body h3:first-child { margin-top: 0; }
.body p { margin: 0.5rem 0; color: #34434e; }
.body ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.body li { margin: 0.35rem 0; color: #34434e; }
.note { font-style: italic; color: var(--muted); }
.na { color: #9a4d15; font-style: italic; font-weight: 600; }

/* Field grid */
.grid { display: grid; gap: 0.85rem 1rem; margin: 0.4rem 0; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.f { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.f > label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.f input, .f textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  background: #fbfdff;
  width: 100%;
}
.f textarea { resize: vertical; min-height: 2.4rem; }
.f input:focus, .f textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 148, 144, 0.16);
}

/* Checklist + checkboxes */
.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.45rem 0; }
.check input[type="checkbox"] { margin: 0.18rem 0 0; width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--teal); cursor: pointer; }
.check span { color: #34434e; }
.yn { display: inline-flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.yn label { display: inline-flex; gap: 0.35rem; align-items: center; font-weight: 600; }
.yn input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--teal); cursor: pointer; }
.inline-field { display: inline-flex; gap: 0.4rem; align-items: center; }
.inline-field input { width: 9rem; border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.45rem; font: inherit; background: #fbfdff; }
.inline-field input[type="checkbox"] { width: auto; border: none; padding: 0; background: none; accent-color: var(--teal); cursor: pointer; }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: 0.7rem 0; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th {
  background: var(--teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.5rem;
  text-align: left;
  vertical-align: middle;
}
.tbl td { border: 1px solid var(--line); padding: 2px; vertical-align: middle; }
.tbl td input, .tbl td textarea { width: 100%; border: none; background: transparent; padding: 0.45rem 0.5rem; font: inherit; }
.tbl td input[type="checkbox"] { width: auto; flex: none; margin: 0; accent-color: var(--teal); cursor: pointer; }
.tbl td input:focus, .tbl td textarea:focus { outline: 2px solid rgba(26, 148, 144, 0.35); outline-offset: -2px; background: #f3fbfa; }
.tbl td.rownum { background: var(--soft); font-weight: 700; text-align: center; width: 2.4rem; color: var(--muted); }
.tbl td.statuscell { white-space: nowrap; padding: 0.4rem 0.5rem; text-align: left; }
.tbl td.statuscell label { display: flex; gap: 0.4rem; align-items: center; justify-content: flex-start; font-size: 0.85rem; margin: 0.12rem 0; }

/* Repeated card blocks (facilities, work history) */
.block { border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem; margin: 0.7rem 0; background: #fcfeff; }
.block-title { font-weight: 700; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.6rem; }

footer.docfoot { text-align: center; font-size: 0.72rem; color: var(--muted); padding: 1.2rem 1.5rem 0; }

@media screen and (max-width: 760px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .doctitle { font-size: 1.2rem; }
}


/* Print: standard Letter pages with clean breaks — no forced section breaks
   (which create blank pages), small units kept intact, multi-column preserved,
   and tightened spacing. Works identically in every browser. */
@media print {
  @page { size: letter; margin: 0.45in; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.cred { background: #fff; margin: 0; font-size: 10px; line-height: 1.35; }
  .toolbar { display: none; }
  .doc { max-width: none; width: auto; margin: 0; border: none; border-radius: 0; box-shadow: none; }
  .f input, .f textarea, .inline-field input, .tbl td input { background: #fff; }

  .section { break-inside: auto; margin-top: 0.45rem; }
  .section > h2 { break-after: avoid; break-inside: avoid; font-size: 0.82rem; padding: 0.35rem 0.8rem; }
  .block, .check, .tbl tr, .tbl thead, .f { break-inside: avoid; }

  .doctitle { font-size: 1.1rem; margin: 0.4rem 0.8rem 0.2rem; }
  .dochead { padding: 0.5rem 0.8rem; }
  .body { padding: 0.35rem 0.8rem 0.5rem; }
  .body p, .body li { margin: 0.12rem 0; }
  .body h3 { margin: 0.35rem 0 0.1rem; font-size: 10.5px; }
  .grid { gap: 0.3rem 0.6rem; }
  .f input, .f textarea { padding: 1px 4px; }
  .f textarea { min-height: 1.2rem; }
  .f > label { font-size: 7.5px; }
  .block { padding: 0.3rem 0.45rem; margin: 0.3rem 0; }
  .block-title { margin-bottom: 0.2rem; }
  .check { margin: 0.12rem 0; }

  .tbl-wrap { overflow: visible; }
  table.tbl { min-width: 0; width: 100%; table-layout: fixed; }
  .tbl th, .tbl td { font-size: 8.5px; padding: 2px 3px; word-break: break-word; }
  .tbl td input { padding: 2px 3px; }
  .inline-field input { width: auto; max-width: 6rem; }

  /* Compact the repeated facility / work blocks: one tight row, no index title */
  #facilities .block, #work-history .block { padding: 0.25rem 0.4rem; margin: 0.3rem 0; }
  #facilities .block-title, #work-history .block-title { display: none; }
  #facilities .grid { grid-template-columns: repeat(6, 1fr); gap: 0.25rem 0.5rem; }
  #work-history .check { margin: 0.15rem 0; }
}
