/* Officer Fitness — restrained federal style */
:root {
  --navy: #16263f;
  --navy-dark: #0e1a2b;
  --navy-light: #24406b;
  --gold: #c8a24a;
  --gold-soft: #f4efdd;
  --red: #b22234;
  --slate: #5a6b7f;
  --slate-light: #eef1f4;
  --line: #d8dee6;
  --text: #1c2733;
  --muted: #55677a;
  --bg: #ffffff;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 17px; }
a { color: var(--navy-light); }
a:hover { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.25; }
h1 { font-size: 2rem; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.45rem; border-bottom: 2px solid var(--gold); padding-bottom: 0.25em; margin-top: 2em; }
h3 { font-size: 1.15rem; margin-top: 1.5em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { background: var(--navy-dark); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand img { width: 38px; height: 20px; border: 1px solid rgba(255,255,255,0.35); }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: bold; letter-spacing: 0.02em; }
.brand-tag { font-size: 0.8rem; color: #c9d4e2; display: block; margin-top: -4px; }
.main-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.main-nav a { color: #dbe4ef; text-decoration: none; font-size: 0.95rem; padding: 4px 2px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }

/* ribbon + hero */
.flag-ribbon { height: 14px; background: repeating-linear-gradient(90deg, var(--red) 0 28px, #fff 28px 56px); border-top: 1px solid #8f1d2b; border-bottom: 1px solid #8f1d2b; }
.hero-figure { margin: 0; }
.hero-figure img { display: block; width: 100%; height: auto; }
.hero-figure figcaption { font-size: 0.85rem; color: var(--muted); padding: 6px 20px 0; max-width: 960px; margin: 0 auto; }
.page-intro { padding: 28px 0 8px; }
.page-mark { width: 48px; height: 48px; margin-bottom: 2px; }
.kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--red); font-weight: 700; margin: 0 0 4px; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 720px; }

/* cards and grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; background: #fff; }
.card h3 { margin-top: 0; }
.card p { margin: 0.4em 0; }
.card .meta { font-size: 0.85rem; color: var(--muted); }
.badge-famous { display: inline-block; background: var(--navy); color: var(--gold); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; }
.badge-tier { display: inline-block; background: var(--slate-light); color: var(--slate); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; }
.callout { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 12px 16px; margin: 20px 0; border-radius: 0 6px 6px 0; }
.callout.red { border-left-color: var(--red); background: #fdf2f3; }
.callout.navy { border-left-color: var(--navy); background: var(--slate-light); }
.callout p { margin: 0.3em 0; }
.callout strong { color: var(--navy); }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
th { background: var(--navy); color: #fff; text-align: left; padding: 9px 10px; font-weight: 600; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:nth-child(even) td { background: #f8fafc; }
.table-wrap { overflow-x: auto; }
.score-table td:first-child { font-weight: 700; text-align: center; width: 64px; }
.score-table th:first-child { text-align: center; }

/* calculator */
.calc { border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: #f8fafc; margin: 20px 0; }
.calc fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.calc legend { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.calc label { display: block; margin: 10px 0 4px; font-weight: 600; }
.calc input[type="number"], .calc input[type="text"], .calc select { width: 100%; max-width: 320px; padding: 9px 10px; font-size: 1rem; border: 1px solid #b9c4d0; border-radius: 5px; }
.calc .hint { font-size: 0.85rem; color: var(--muted); margin: 2px 0 0; }
.calc .sex-row { display: flex; gap: 20px; }
.calc .sex-row label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 5px; padding: 11px 22px; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-light); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy-dark); font-weight: 700; }
.btn-gold:hover { background: #d9b45e; color: var(--navy-dark); }
.result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.result .verdict { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.verdict.pass { color: #1e6b3a; }
.verdict.fail { color: var(--red); }
.verdict.near { color: #8a6d1a; }

/* checklists */
.checklist { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin: 20px 0; }
.checklist h3 { margin-top: 0; }
.checklist ul { list-style: none; padding: 0; margin: 10px 0; }
.checklist li { padding: 7px 0 7px 30px; position: relative; border-bottom: 1px dashed #e3e8ee; }
.checklist li:last-child { border-bottom: 0; }
.checklist input[type="checkbox"] { position: absolute; left: 0; top: 11px; width: 18px; height: 18px; }
.progress { font-size: 0.9rem; color: var(--muted); }
.progress-bar { height: 8px; background: var(--slate-light); border-radius: 4px; overflow: hidden; margin: 6px 0 12px; }
.progress-bar span { display: block; height: 100%; background: var(--gold); width: 0%; transition: width 0.2s; }
.movement { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed #e3e8ee; }
.movement:last-child { border-bottom: 0; }
.movement .num { color: var(--muted); font-size: 0.85rem; min-width: 28px; text-align: right; }
.movement input { flex: none; }

/* change entries */
.change { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin: 20px 0; }
.change h3 { margin-top: 0; }
.change .date { font-size: 0.85rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: 0.06em; }
.source-line { font-size: 0.85rem; color: var(--muted); }
.source-line a { color: var(--muted); }

/* footer */
.site-footer { background: var(--navy-dark); color: #c9d4e2; margin-top: 48px; padding: 28px 0 36px; font-size: 0.9rem; }
.site-footer a { color: #e8edf3; }
.site-footer .disclaimer { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 16px; margin-top: 16px; }
.site-footer p { margin: 0.5em 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.updated { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .brand-tag { display: none; }
  .main-nav { margin-left: 0; }
}
@media print {
  .site-header, .site-footer, .flag-ribbon, .no-print { display: none !important; }
  body { font-size: 12pt; }
  .checklist { break-inside: avoid; page-break-inside: avoid; }
  a { color: var(--text); text-decoration: none; }
  /* scorecard-only printing: when body.printing is set, hide everything except the chosen scorecard */
  body.printing main > :not(.print-active):not(.scorecard) { display: none !important; }
  body.printing .calc-grid.print-active > :not(.print-active) { display: none !important; }
  body.printing .calc-card.print-active > :not(.scorecard) { display: none !important; }
  body.printing .scorecard { display: block !important; break-inside: avoid; page-break-inside: avoid; }
  /* prep-plan-only printing: when body.printing-plan is set, hide everything except the plan output */
  body.printing-plan main > :not(#prep-plan-output) { display: none !important; }
  body.printing-plan #prep-plan-output .plan-week { break-inside: avoid; page-break-inside: avoid; }
  body.printing-plan #prep-plan-output .plan-print-head { display: block !important; }
}

/* compact calculator cards */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }
.calc-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fff; }
.calc-card h3 { margin: 0 0 2px; }
.calc-card .pass-rule { font-size: 0.88rem; color: var(--muted); margin: 0 0 10px; }
.calc-card .calc-row { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.calc-card .calc-row label { font-size: 0.88rem; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.calc-card .calc-row input[type="number"], .calc-card .calc-row input[type="text"] { width: 110px; padding: 7px 8px; font-size: 0.95rem; border: 1px solid #b9c4d0; border-radius: 5px; }
.calc-card .calc-row select { padding: 7px 8px; font-size: 0.95rem; border: 1px solid #b9c4d0; border-radius: 5px; background: #fff; }
.calc-card .sex-row { display: flex; gap: 16px; margin-bottom: 8px; font-size: 0.9rem; }
.calc-card .sex-row label { font-weight: 400; display: flex; gap: 5px; align-items: center; }
.calc-card .step-check { display: flex; gap: 6px; align-items: flex-start; font-size: 0.88rem; font-weight: 400; margin: 0 0 8px; }
.calc-card .step-check input { margin-top: 3px; flex: none; }
.calc-card .btn { padding: 8px 16px; font-size: 0.95rem; }
.calc-card .result { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 0.95rem; }
.calc-card .result table { margin: 8px 0; font-size: 0.9rem; }
.calc-card .result .verdict { font-size: 1.1rem; }
.calc-card .source-line { margin: 8px 0 0; }

/* scorecard */
.scorecard { border: 1px solid var(--navy); border-radius: 6px; padding: 12px 14px; margin-top: 12px; background: #fff; }
.scorecard-head { display: flex; justify-content: space-between; gap: 12px; font-size: 1rem; border-bottom: 2px solid var(--gold); padding-bottom: 6px; margin-bottom: 6px; }
.scorecard-head span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.scorecard-sub { font-size: 0.85rem; color: var(--muted); margin: 0 0 6px; }
.scorecard table { margin: 6px 0; font-size: 0.9rem; }
.scorecard .verdict { font-size: 1.05rem; margin: 8px 0 4px; }
.scorecard-foot { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }
.btn-print { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-print:hover { background: var(--slate-light); color: var(--navy); }

/* logo */
.brand img.brand-logo { height: 64px; width: auto; display: block; border: 0; border-radius: 4px; }
@media (max-width: 640px) {
  .brand img.brand-logo { height: 48px; }
}

/* prep plan generator */
#prep-baseline .calc-row { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
#prep-baseline .calc-row label { font-size: 0.9rem; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
#prep-baseline .calc-row input[type="number"], #prep-baseline .calc-row input[type="text"] { width: 180px; padding: 7px 8px; font-size: 0.95rem; border: 1px solid #b9c4d0; border-radius: 5px; }
#prep-baseline .step-check { display: flex; gap: 6px; align-items: flex-start; font-size: 0.9rem; font-weight: 400; margin: 0 0 8px; }
#prep-baseline .step-check input { margin-top: 3px; flex: none; }
#prep-sex-row, #prep-age-row { margin-bottom: 8px; }
#prep-sex-row label { font-weight: 400; display: inline-flex; gap: 5px; align-items: center; margin-right: 16px; }
#prep-age-row label { font-size: 0.9rem; font-weight: 600; }
#prep-age-row select { padding: 7px 8px; font-size: 0.95rem; border: 1px solid #b9c4d0; border-radius: 5px; background: #fff; margin-left: 6px; }
.assumed { color: var(--muted); font-size: 0.85em; }
.plan-week { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; }
.plan-week summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: var(--navy); list-style: none; }
.plan-week summary::-webkit-details-marker { display: none; }
.plan-week summary::before { content: "\25B8  "; color: var(--gold); }
.plan-week[open] summary::before { content: "\25BE  "; }
.plan-week table { margin: 0 0 6px; font-size: 0.9rem; }
.plan-week td:first-child { width: 64px; font-weight: 700; white-space: nowrap; }
.plan-week td { padding: 6px 10px; }
.plan-targets { font-size: 0.88rem; color: var(--muted); padding: 0 14px; margin: 0 0 4px; }
.plan-rest { font-size: 0.85rem; color: var(--muted); padding: 0 14px 10px; margin: 0; }
.plan-print-head h2 { margin-bottom: 0; }
