:root {
  color-scheme: light;
  --bg: #fdf9f6;
  --surface: rgba(255, 253, 250, 0.72);
  --surface-soft: rgba(246, 239, 232, 0.62);
  --ink: #1a1d21;
  --muted: #58626b;
  --line: rgba(50, 96, 128, 0.1);
  --accent: #326080;
  --accent-soft: rgba(181, 210, 230, 0.18);
  --accent-deep: #254a63;
  --sand: #fff1e7;
  --mist: #b5d2e6;
  --copper: #805232;
  --shadow: 0 16px 34px rgba(50, 96, 128, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: rgba(181, 210, 230, 0.08);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.app-shell {
  width: min(1200px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero {
  max-width: 840px;
  margin: 0 auto 24px;
  text-align: center;
}

.hero h1 {
  margin-bottom: 14px;
  font-size: clamp(3rem, 7vw, 5.1rem);
  letter-spacing: -0.05em;
  line-height: 0.96;
  color: var(--accent-deep);
}

.brand-link:hover {
  text-decoration: none;
}

.lede,
.home-note p,
.profile-list,
.mini-card p,
.article-list span,
.profile-icd,
.profile-category,
.directory-meta,
.search-meta,
.empty-copy {
  color: var(--muted);
  line-height: 1.6;
}

.lede {
  max-width: 62ch;
  margin: 0 auto;
  font-size: 1.08rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.workspace--single {
  grid-template-columns: 1fr;
}

body[data-page="detail"] .workspace {
  grid-template-columns: 1fr;
}

.panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.search-panel {
  position: sticky;
  top: 18px;
}

body[data-page="detail"] .search-panel {
  display: none;
}

body[data-page="detail"] .detail-panel {
  max-width: 980px;
  margin: 0 auto;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-input-wrap {
  margin-bottom: 10px;
}

input[type="search"] {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  outline: none;
}

input[type="search"]:focus {
  border-color: rgba(50, 96, 128, 0.36);
  box-shadow: 0 0 0 4px rgba(181, 210, 230, 0.16);
}

.search-meta {
  margin-bottom: 14px;
  font-size: 0.94rem;
}

.directory-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.directory-list__item {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.directory-link {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.directory-link:hover,
.directory-link--active {
  color: var(--accent-deep);
}

.directory-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.92rem;
}

.directory-list--compact {
  margin-top: 16px;
}

.detail-view {
  min-height: 420px;
}

.home-note {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.home-note__eyebrow {
  margin-bottom: 10px;
  color: var(--copper);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-note h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.ad-slot {
  margin: 28px auto 0;
}

.profile-section + .ad-slot {
  margin-top: 20px;
}

.ad-slot + .profile-section {
  margin-top: 20px;
}

.ad-slot__label {
  display: block;
  margin-bottom: 8px;
  color: var(--copper);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ad-slot__box {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  border: 1px dashed rgba(50, 96, 128, 0.35);
  border-radius: 20px;
  background: rgba(181, 210, 230, 0.1);
  color: var(--muted);
  text-align: center;
}

.ad-slot--banner .ad-slot__box {
  min-height: 140px;
}

.ad-slot--inline .ad-slot__box {
  min-height: 120px;
}

.profile {
  max-width: 860px;
  margin: 0 auto;
}

.profile-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-header h1 {
  margin-bottom: 8px;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

.profile-category {
  margin-bottom: 8px;
  color: var(--copper);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-section + .profile-section {
  margin-top: 28px;
}

.profile-section > h3 {
  margin-bottom: 14px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.criteria-title,
.criterion-card h3 {
  font-family: "Avenir Next Condensed", "Franklin Gothic Medium", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.summary-title,
.home-note h2,
.profile-header h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.profile-section--summary {
  padding: 20px 22px;
  border: 1px solid rgba(128, 82, 50, 0.15);
  border-radius: 24px;
  background: rgba(255, 241, 231, 0.42);
}

.criteria-title {
  color: var(--accent-deep);
  font-size: 1.28rem;
}

.criterion-card {
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.criterion-card + .criterion-card {
  margin-top: 14px;
}

.criterion-card--0 {
  background: rgba(181, 210, 230, 0.26);
}

.criterion-card--1 {
  background: rgba(255, 241, 231, 0.38);
}

.criterion-card--2 {
  background: rgba(181, 210, 230, 0.16);
}

.criterion-card--3 {
  background: rgba(128, 82, 50, 0.08);
}

.criterion-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 10px;
}

.criterion-card__header h3 {
  margin-bottom: 0;
  color: var(--accent-deep);
  font-size: 1.2rem;
}

.criterion-card__eyebrow {
  margin-bottom: 0;
  color: var(--copper);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-list {
  margin: 0;
  padding-left: 20px;
}

.profile-list li + li {
  margin-top: 10px;
}

.card-stack {
  display: grid;
  gap: 14px;
}

.treatment-extras {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.mini-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(181, 210, 230, 0.12);
}

.mini-card h4 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.mini-card p {
  margin-bottom: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.94rem;
  font-weight: 500;
}

.article-list {
  margin: 0;
  padding-left: 20px;
}

.article-list li + li {
  margin-top: 12px;
}

.article-list a {
  display: block;
  color: var(--accent-deep);
  font-weight: 600;
}

.article-list a:hover,
.back-link:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent-deep);
  font-weight: 600;
}

.site-footer {
  max-width: 980px;
  margin: 28px auto 0;
  padding: 20px 12px 0;
  border-top: 1px solid var(--line);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  justify-content: center;
  margin-bottom: 12px;
}

.site-footer__links a {
  color: var(--accent-deep);
  font-weight: 600;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.site-footer__note {
  max-width: 70ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
  text-align: center;
}

.profile--info {
  max-width: 760px;
}

.lede--narrow {
  max-width: 58ch;
  margin-bottom: 0;
}

.info-section p + p {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .search-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 1200px);
    padding: 20px 0 32px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }
}
