:root {
  --brand:#005AA0;
  --brand-dark:#004682;
  --brand-50:#e6f0f8;
  --brand-100:#cce0f1;
  --gold:#B08B4F;
  --gold-bg:#f9f1e1;
  --grey:#54575A;
  --ink:#1f2937;
  --muted:#6b7280;
  --line:#e5e7eb;
  --paper:#ffffff;
  --canvas:#f7f8fa;
  --warn:#b45309;
  --warn-bg:#fef3c7;
  --ok:#047857;
  --ok-bg:#d1fae5;
  --crit:#b91c1c;
  --crit-bg:#fee2e2;
}
* { box-sizing:border-box; }
html, body {
  margin:0; padding:0; background:var(--canvas); color:var(--ink);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size:14px; line-height:1.55;
}
.doc {
  max-width:980px; margin:0 auto; background:var(--paper);
  box-shadow:0 0 0 1px var(--line);
}

/* ===== Header ===== */
.page-header {
  background: var(--brand-dark);
  color:#fff;
  padding:30px 40px;
  display:flex; align-items:center; gap:28px;
  border-bottom:4px solid var(--gold);
}
.pcl-logo { display:block; width:120px; height:auto; flex-shrink:0; }
.ph-divider { width:1px; align-self:stretch; background:rgba(255,255,255,0.25); margin:6px 0; }
.ph-right { flex:1; }
.ph-kicker {
  font-family: "Source Sans 3", sans-serif;
  font-size:9.5px; letter-spacing:1.2px; text-transform:uppercase;
  opacity:0.85; font-weight:500;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ph-title {
  font-family: "Cinzel", "Source Sans 3", serif;
  margin:4px 0 3px; font-size:22px; font-weight:600;
  letter-spacing:0.5px; color:#fff;
}
.ph-meta { font-size:12px; opacity:0.78; line-height:1.35; }
.ph-authors {
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin-top:5px;
  font-size:11px;
  opacity:0.7;
  letter-spacing:0.2px;
}
.ph-authors + .ph-authors { margin-top:2px; }
.ph-authors-label {
  font-size:9.5px;
  font-weight:700;
  letter-spacing:1.6px;
  text-transform:uppercase;
  opacity:0.6;
  padding-top:2px;
  flex-shrink:0;
  min-width:100px;
}
.ph-author-list > div { line-height:1.4; }

/* ===== Tab Strip ===== */
.tabs {
  display:flex;
  background:var(--brand-50);
  border-bottom:2px solid var(--brand);
  padding:0;
  position:sticky;
  top:0;
  z-index:10;
  box-shadow:0 1px 0 rgba(0,0,0,0.04);
}
.tab {
  flex:1;
  background:none;
  border:0;
  padding:14px 12px;
  font-family:"Source Sans 3", sans-serif;
  font-size:11.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:1.1px;
  color:var(--muted);
  cursor:pointer;
  border-bottom:3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align:center;
  outline:none;
}
.tab:hover {
  color:var(--brand-dark);
  background:rgba(255,255,255,0.55);
}
.tab:focus-visible {
  background:rgba(255,255,255,0.7);
  color:var(--brand-dark);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.tab.active {
  color:var(--brand-dark);
  background:#ffffff;
  border-bottom-color:var(--gold);
}
.tab .tab-secnum {
  display:block;
  color:var(--gold);
  font-family:"Cinzel", serif;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.4px;
  margin-bottom:3px;
  opacity:0.9;
}

/* ===== Tab Panes ===== */
.tab-pane { display:none; }
.tab-pane.active { display:block; }

/* ===== KPI bar ===== */
.kpi-bar { display:flex; border-bottom:1px solid var(--line); background:#fcfcfd; }
.kpi-item { flex:1; padding:16px 12px; text-align:center; border-right:1px solid var(--line); }
.kpi-item:last-child { border-right:0; }
.kpi-n {
  font-size:24px; font-weight:700; color:var(--brand-dark); line-height:1.1;
  font-family:"Cinzel", serif;
}
.kpi-l {
  font-size:10.5px; letter-spacing:1px; text-transform:uppercase;
  color:var(--muted); margin-top:5px;
}

/* ===== Blocks ===== */
.block { padding:26px 40px; border-bottom:1px solid var(--line); }
.block:last-of-type { border-bottom:0; }
.block h2 {
  margin:0 0 6px; font-size:17px; color:var(--brand-dark);
  text-transform:uppercase; letter-spacing:1.6px;
  border-bottom:2px solid var(--brand); padding-bottom:8px;
  font-family:"Source Sans 3", sans-serif; font-weight:700;
}
.block h2 .secnum { color:var(--gold); margin-right:10px; font-weight:700; }
.block .lede { color:var(--muted); font-size:12.5px; margin:4px 0 14px; font-style:italic; }
.block h3 {
  margin:18px 0 8px; font-size:13.5px; color:var(--ink);
  text-transform:uppercase; letter-spacing:1px; font-weight:700;
}
.block h4 {
  margin:14px 0 6px; font-size:13.5px; color:var(--brand-dark); font-weight:600;
}
.block p { margin:8px 0; }
.block ul { margin:8px 0 8px 22px; padding:0; }
.block li { margin:6px 0; }

/* ===== Pills ===== */
.pill {
  display:inline-block; padding:3px 10px; border-radius:11px;
  font-size:10.5px; font-weight:600; letter-spacing:0.5px;
  text-transform:uppercase;
}
.pill-ok { background:var(--ok-bg); color:var(--ok); }
.pill-warn { background:var(--warn-bg); color:var(--warn); }
.pill-crit { background:var(--crit-bg); color:var(--crit); }
.pill-brand { background:var(--brand-50); color:var(--brand-dark); }
.pill-gold { background:var(--gold-bg); color:#7a5e2e; }

/* ===== Impact / vessel meta / RCA / events ===== */
.impact-box {
  background:var(--brand-50);
  border-left:3px solid var(--brand);
  padding:14px 18px;
  margin:0 0 18px 0;
  border-radius:0 4px 4px 0;
  font-size:13px;
}
.impact-box .impact-label {
  font-size:10.5px; letter-spacing:1.2px; text-transform:uppercase;
  color:var(--brand-dark); font-weight:700;
  display:block; margin-bottom:6px;
}

.rca-section {
  margin:20px 0;
  padding:18px 22px;
  background:#fcfcfd;
  border:1px solid var(--line);
  border-left:4px solid var(--gold);
  border-radius:0 4px 4px 0;
}
.rca-section h3 {
  margin:0 0 10px; font-size:14px;
  color:var(--brand-dark); font-weight:700;
  text-transform:none; letter-spacing:0.3px;
  font-family:"Source Sans 3", sans-serif;
}
.rca-section h3 .qmark {
  color:var(--gold); font-family:"Cinzel", serif;
  margin-right:8px; font-size:18px; font-weight:700;
}
.rca-section p { margin:6px 0; }
.rca-section p:first-of-type { margin-top:0; }
.rca-section ul { margin:8px 0 4px 22px; }
.rca-section li { margin:5px 0; }

.event-block {
  margin:14px 0;
  padding:12px 16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:4px;
}
.event-block h4 {
  margin:0 0 8px;
  font-size:12.5px;
  color:var(--brand-dark);
  text-transform:uppercase;
  letter-spacing:1.2px;
}
.event-block h4 .event-date {
  background:var(--brand-dark); color:#fff;
  padding:2px 8px; border-radius:3px;
  font-size:10.5px; margin-right:8px;
  letter-spacing:0.8px;
}

.vessel-meta-row {
  display:flex; flex-wrap:wrap; gap:10px 24px;
  padding:14px 0 8px; margin-bottom:14px;
  border-bottom:1px solid var(--line);
  font-size:12px;
}
.vessel-meta-row .vm-item .vm-label {
  display:block; text-transform:uppercase;
  font-size:10px; letter-spacing:1px;
  color:var(--muted); font-weight:600; margin-bottom:2px;
}
.vessel-meta-row .vm-item .vm-value { color:var(--ink); font-weight:500; }

/* ===== Tables ===== */
table { width:100%; border-collapse:collapse; font-size:12.5px; margin:10px 0; }
th, td { padding:8px 11px; text-align:left; border-bottom:1px solid var(--line); vertical-align:top; }
th {
  background:var(--brand-50); color:var(--brand-dark);
  text-transform:uppercase; letter-spacing:0.8px;
  font-size:10.5px; font-weight:700;
  border-bottom:2px solid var(--brand);
}
tbody tr:nth-child(even) { background:#fafbfc; }

/* ===== Notes ===== */
.note {
  background:var(--brand-50); border-left:3px solid var(--brand);
  padding:12px 16px; margin:14px 0; font-size:12.5px;
  border-radius:0 4px 4px 0;
}
.note.warn { background:var(--warn-bg); border-left-color:var(--warn); }
.note.crit { background:var(--crit-bg); border-left-color:var(--crit); }
.note.gold { background:var(--gold-bg); border-left-color:var(--gold); }

/* ===== Tech detail ===== */
.tech-detail {
  background:#f5f6f8; padding:10px 14px; margin:8px 0;
  border-left:2px solid var(--grey);
  font-family:"SF Mono", Monaco, Consolas, "Courier New", monospace;
  font-size:11.5px; line-height:1.5; color:#374151;
  overflow-x:auto;
}

/* ===== Milestone status strip (inside RCA bullets) ===== */
.milestones {
  margin:10px 0 4px;
  padding:12px 14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:4px;
}
.milestones-label {
  display:block;
  font-size:10px;
  font-weight:700;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:8px;
  padding-bottom:6px;
  border-bottom:1px solid var(--line);
}
.ms-item {
  display:flex;
  align-items:center;
  gap:12px;
  padding:5px 0;
  border-bottom:1px dashed var(--line);
  font-size:12px;
}
.ms-item:last-child { border-bottom:0; }
.ms-pill-wrap {
  min-width:160px;
  flex-shrink:0;
}
.ms-label {
  color:var(--ink);
  font-weight:500;
  line-height:1.3;
}
@media (max-width:520px) {
  .ms-item { flex-direction:column; align-items:flex-start; gap:4px; }
  .ms-pill-wrap { min-width:0; }
}

/* ===== Theme grid ===== */
.theme-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:14px 0; }
@media (max-width:720px) { .theme-grid { grid-template-columns:1fr; } }
.theme-card {
  border:1px solid var(--line); border-radius:4px;
  background:#fff; padding:16px 18px;
  border-top:3px solid var(--brand);
}
.theme-card h4 { margin:0 0 6px; font-size:13px; color:var(--brand-dark); font-weight:700; }
.theme-card .theme-tag {
  font-size:10.5px; letter-spacing:0.8px; text-transform:uppercase;
  color:var(--gold); font-weight:600; display:block; margin-bottom:8px;
}
.theme-card p { margin:6px 0; font-size:12.5px; }
.theme-card .vessels {
  font-size:11px; color:var(--muted);
  margin-top:10px; padding-top:8px; border-top:1px dashed var(--line);
}

/* ===== Footer ===== */
.doc-footer {
  background:#fcfcfd; padding:18px 40px; font-size:11.5px;
  color:var(--muted); text-align:center;
  border-top:2px solid var(--gold);
}
.doc-footer .footer-brand {
  color:var(--brand-dark); font-weight:600;
  font-family:"Cinzel", serif; letter-spacing:1px;
}

/* ===== Responsive · Tablet / small laptop (≤720px) ===== */
@media (max-width:720px) {
  .doc { box-shadow:none; }
  .page-header { padding:22px 22px; gap:18px; }
  .pcl-logo { width:90px; }
  .ph-divider { display:none; }
  .ph-kicker {
    font-size:9.5px;
    letter-spacing:1.1px;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    line-height:1.4;
  }
  .ph-title { font-size:20px; }

  /* Tab strip — horizontal scroll instead of cramping */
  .tabs {
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  .tabs::-webkit-scrollbar { height:4px; }
  .tabs::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.18); border-radius:2px; }
  .tab {
    flex:0 0 auto;
    min-width:130px;
    font-size:10.5px;
    padding:10px 12px;
    letter-spacing:0.8px;
  }

  /* Block padding tighter */
  .block { padding:20px 22px; }

  /* Tables — slightly smaller text and tighter cells so they fit */
  table { font-size:11.5px; }
  th, td { padding:7px 8px; }

  /* Vessel meta row wraps more aggressively */
  .vessel-meta-row { gap:10px 16px; }

  /* Footer padding tighter */
  .doc-footer { padding:14px 22px; }
}

/* ===== Responsive · Narrow phone (≤520px) ===== */
@media (max-width:520px) {
  .page-header {
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
    padding:18px 18px;
  }
  .pcl-logo { width:80px; }
  .ph-divider { display:none; }
  .ph-right { width:100%; }
  .ph-title { font-size:18px; }

  /* Authors / Contributors stack — drop the aligned column */
  .ph-authors { flex-direction:column; gap:3px; margin-top:6px; }
  .ph-authors-label { min-width:0; padding-top:0; opacity:0.55; }
  .ph-authors + .ph-authors { margin-top:6px; }

  /* KPI bar — 2 × 2 grid */
  .kpi-bar {
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .kpi-item {
    border-right:1px solid var(--line);
    border-bottom:1px solid var(--line);
    padding:12px 8px;
  }
  .kpi-item:nth-child(2n) { border-right:0; }
  .kpi-item:nth-last-child(-n+2) { border-bottom:0; }
  .kpi-n { font-size:20px; }
  .kpi-l { font-size:9.5px; }

  /* Block padding tighter still */
  .block { padding:16px 18px; }
  .block h2 { font-size:15px; letter-spacing:1.2px; }
  .rca-section { padding:14px 16px; }

  /* Tables — allow horizontal scroll if content forces width */
  table { font-size:11px; }
  th, td { padding:6px 7px; }

  /* Tech detail block — wrap rather than scroll */
  .tech-detail { font-size:10.5px; }

  /* Vessel meta row stacks fully */
  .vessel-meta-row { gap:8px 14px; font-size:11.5px; }
}
