:root {
  --navy: #24364b;
  --navy-deep: #17283b;
  --navy-soft: #40566d;
  --gold: #a58a67;
  --gold-light: #c8b38f;
  --paper: #f3f0e9;
  --white: #ffffff;
  --ink: #303438;
  --muted: #68727c;
  --line: rgba(36, 54, 75, 0.15);
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.workspace-header {
  min-height: 92px;
  padding: 18px max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--white);
  background: var(--navy-deep);
  border-bottom: 1px solid rgba(200, 179, 143, 0.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(200, 179, 143, 0.7);
  border-radius: 50%;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 0.86rem;
  letter-spacing: 0.09em;
}

.context-label,
.library-state,
.empty-state {
  border: 1px solid rgba(200, 179, 143, 0.42);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.context-label {
  padding: 8px 13px;
  color: var(--gold-light);
}

main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.intro {
  padding: clamp(20px, 3vw, 32px) 0 24px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  color: var(--navy-deep);
  font-size: clamp(3.1rem, 7vw, 5.4rem);
  letter-spacing: -0.045em;
}

.intro-text {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--navy-soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.clinical-note {
  max-width: 860px;
  margin-top: 18px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.72);
}

.clinical-note strong {
  color: var(--navy);
}

.clinical-note p {
  margin: 0;
  color: var(--muted);
}

.library {
  padding: 22px 0 112px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.update-flow h2 {
  color: var(--navy-deep);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.library-state {
  margin-bottom: 5px;
  padding: 8px 13px;
  color: var(--navy-soft);
  background: rgba(255, 255, 255, 0.55);
}

.category-grid {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  min-height: 300px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--white);
}

.category-number {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.category-card h3 {
  margin-top: 48px;
  color: var(--navy-deep);
  font-size: 2rem;
}

.category-card p {
  margin: 18px 0 28px;
  color: var(--muted);
}

.empty-state {
  width: fit-content;
  margin-top: auto;
  padding: 7px 11px;
  color: var(--muted);
  border-color: var(--line);
}

.update-flow {
  margin-top: 70px;
  padding: 42px;
  color: var(--white);
  background: var(--navy-deep);
}

.update-flow .eyebrow {
  color: var(--gold-light);
}

.update-flow h2 {
  max-width: 680px;
  color: var(--white);
}

.update-flow > p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: #d7dfe8;
}

footer {
  min-height: 92px;
  padding: 24px max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #d7dfe8;
  background: #0c1d30;
  font-size: 0.84rem;
}

footer a {
  color: var(--gold-light);
  text-underline-offset: 4px;
}

[hidden] { display: none !important; }
.library-lead { color: var(--navy-soft); font-size: 1.08rem; margin: 20px 0 30px; }
.search-label { display: block; color: var(--navy); font-weight: 600; margin-bottom: 9px; }
.library-search { display: block; width: 100%; max-width: 580px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--ink); font: inherit; }
.library-search:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-status { min-height: 25px; margin: 9px 0 0; color: var(--muted); font-size: .9rem; }
.subheading { color: var(--navy-deep); font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 45px 0 20px; }
.section-note { max-width: 780px; color: var(--muted); margin: -4px 0 22px; }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.resource-card, .model-card, .model-group { background: var(--white); border: 1px solid var(--line); min-width: 0; }
.resource-card > summary, .model-card > summary, .model-group > summary { cursor: pointer; list-style: none; }
.resource-card > summary::-webkit-details-marker, .model-card > summary::-webkit-details-marker, .model-group > summary::-webkit-details-marker { display: none; }
.resource-card > summary { min-height: 145px; padding: 22px; display: flex; flex-direction: column; }
.resource-type { color: #836a45; text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 600; }
.resource-card strong { margin-top: 17px; color: var(--navy-deep); font-family: var(--serif); font-size: 1.65rem; font-weight: 400; line-height: 1.2; }
.view-label { margin-top: auto; padding-top: 14px; color: var(--navy-soft); font-size: .88rem; }
.resource-body, .model-body { padding: 20px 22px 24px; border-top: 1px solid var(--line); }
.resource-body > p { margin: 0 0 14px; color: var(--muted); }
.copy-button { padding: 9px 15px; border: 1px solid var(--navy); background: var(--navy); color: var(--white); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.copy-button:hover { background: var(--navy-deep); }
pre { max-height: 480px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; background: #f7f8f9; border: 1px solid var(--line); color: var(--ink); font: .9rem/1.65 var(--sans); }
.model-groups { display: grid; gap: 10px; }
.model-group > summary { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; padding: 20px 23px; }
.model-group > summary strong { color: var(--navy-deep); font-size: 1.04rem; }
.model-group > summary span { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; background: #e9e8e4; }
.model-card > summary { padding: 14px 17px; color: var(--navy); font-weight: 600; }
.model-card[open] { grid-column: 1 / -1; }
.model-card[open] > summary { background: var(--navy-deep); color: var(--white); }
.model-body pre { max-height: none; }
.clinical-reminder { margin-top: 54px; padding: 24px 28px; border-left: 3px solid var(--gold); background: rgba(255,255,255,.75); }
.clinical-reminder strong { color: var(--navy); }
.clinical-reminder p { margin: 7px 0 0; color: var(--muted); }

@media (max-width: 820px) {
  .resource-grid, .model-grid { grid-template-columns: 1fr; }
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 250px;
  }

  .clinical-note {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .workspace-header {
    min-height: 78px;
  }

  .brand > span:last-child {
    display: none;
  }

  main {
    width: min(100% - 32px, 1120px);
  }

  .intro {
    padding: 32px 0 34px;
  }

  .section-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-card,
  .update-flow {
    padding: 24px;
  }

  .library {
    padding-bottom: 80px;
  }
}

.download-original { display: inline-block; padding: 10px 16px; margin: 0 12px 14px 0; background: var(--navy); color: var(--white); font-size: 1rem; font-weight: 600; text-decoration: none; }
.download-original:hover { background: var(--navy-deep); }
.download-original:focus-visible { outline: 3px solid #b48a4d; outline-offset: 3px; }
