:root {
  --cbrc-navy: #071522;
  --cbrc-navy-2: #10283a;
  --cbrc-gold: #b98a3b;
  --cbrc-gold-light: #d8b86b;
  --cbrc-parchment: #f4efe4;
  --cbrc-ink: #1d2730;
  --cbrc-muted: #66717a;
  --cbrc-border: #d8cfbe;
  --cbrc-white: #ffffff;
}

.cbrc-record-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin: 1.5rem 0;
  border: 1px solid var(--cbrc-border);
  background: var(--cbrc-parchment);
}

.cbrc-record-control > div { padding: .8rem 1rem; border-right: 1px solid var(--cbrc-border); }
.cbrc-record-control dt, .cbrc-eyebrow { color: #76551f; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cbrc-record-control dd { margin: .2rem 0 0; color: var(--cbrc-ink); }

.cbrc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.cbrc-card { padding: 1.35rem; border: 1px solid var(--cbrc-border); border-top: 3px solid var(--cbrc-gold); background: var(--cbrc-white); box-shadow: 0 8px 24px rgba(7, 21, 34, .07); }
.cbrc-card--person { padding: 0; overflow: hidden; }
.cbrc-card__body { padding: 1.35rem; }
.cbrc-card-portrait { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--cbrc-parchment); }
.cbrc-card-portrait__figure { width: 100%; height: 100%; margin: 0; }
.cbrc-card-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.cbrc-card h3 { margin: .25rem 0 .6rem; }
.cbrc-card-link, .cbrc-related a { color: #76551f; font-weight: 700; }
.cbrc-textual-hub .cbrc-record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.cbrc-hub-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.cbrc-page-button { display: inline-flex; align-items: center; justify-content: center; padding: .78rem 1.1rem; border: 1px solid var(--cbrc-gold); background: var(--cbrc-navy); color: var(--cbrc-white) !important; font-weight: 700; text-decoration: none; }
.cbrc-page-button--secondary { background: var(--cbrc-white); color: var(--cbrc-navy) !important; }

.cbrc-search { display: flex; gap: .65rem; margin: 1.25rem 0 2rem; }
.cbrc-search input { flex: 1; min-width: 0; padding: .8rem 1rem; border: 1px solid var(--cbrc-border); }
.cbrc-search button, .cbrc-correction-form button { padding: .8rem 1.2rem; border: 1px solid var(--cbrc-gold); background: var(--cbrc-navy); color: var(--cbrc-white); cursor: pointer; }

.cbrc-citation { margin: 1.5rem 0; padding: 1rem 1.2rem; border-left: 4px solid var(--cbrc-gold); background: var(--cbrc-parchment); }
.cbrc-citation p { margin: .35rem 0 0; }
.cbrc-related, .cbrc-revisions { padding-left: 1.25rem; }
.cbrc-related li, .cbrc-revisions li { margin: .45rem 0; }
.cbrc-typed-links small { display: block; margin: .2rem 0 .65rem; color: var(--cbrc-muted); }
.cbrc-link-kind { display: inline-block; min-width: 8.8rem; color: #76551f; font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

.cbrc-glossary-entry__lead { margin: 1.25rem 0; padding: .65rem 0 .65rem 1rem; border-left: 4px solid var(--cbrc-gold); font-size: 1.15rem; line-height: 1.6; }
.cbrc-glossary-entry__aliases { color: var(--cbrc-muted); font-size: .94rem; }
.cbrc-glossary-entry section { margin: 1.8rem 0; }
.cbrc-glossary-entry__sources { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--cbrc-border); }

.cbrc-correction-form { max-width: 860px; }
.cbrc-correction-form label { display: grid; gap: .35rem; color: var(--cbrc-ink); font-weight: 700; }
.cbrc-correction-form input, .cbrc-correction-form textarea, .cbrc-correction-form select { width: 100%; padding: .72rem; border: 1px solid var(--cbrc-border); background: var(--cbrc-white); color: var(--cbrc-ink); font: inherit; }
.cbrc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cbrc-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.cbrc-notice { padding: .8rem 1rem; border-left: 4px solid; }
.cbrc-success { border-color: #356b47; background: #edf6ef; }
.cbrc-error { border-color: #9b3838; background: #faeeee; }
.cbrc-empty { color: var(--cbrc-muted); font-style: italic; }

.cbrc-explorer,
.cbrc-corpus-browser,
.cbrc-guide,
.cbrc-record-details {
  margin: 2rem 0;
  color: var(--cbrc-ink);
}

.cbrc-record-main { margin: 1rem 0 2rem; }
.cbrc-record-main::after { display: block; clear: both; content: ""; }
.cbrc-record-lead { margin: 0 0 1.5rem; padding: .85rem 0 .85rem 1.15rem; border-left: 4px solid var(--cbrc-gold); color: var(--cbrc-ink); font-size: 1.12rem; line-height: 1.65; }
.cbrc-record-lead p { margin: 0; }
.cbrc-person-portrait--record { float: right; width: min(34%, 320px); margin: 0 0 1.25rem 1.75rem; }
.cbrc-person-portrait--record img { display: block; width: 100%; height: auto; border: 1px solid var(--cbrc-border); box-shadow: 0 8px 24px rgba(7, 21, 34, .10); }

.cbrc-explorer__intro {
  max-width: 780px;
  margin-bottom: 1.25rem;
}

.cbrc-filters {
  margin: 1.25rem 0;
  padding: 1.2rem;
  border: 1px solid var(--cbrc-border);
  background: var(--cbrc-parchment);
}

.cbrc-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
}

.cbrc-filter-grid label {
  display: grid;
  gap: .3rem;
  color: var(--cbrc-ink);
  font-size: .84rem;
  font-weight: 700;
}

.cbrc-filter-grid input,
.cbrc-filter-grid select {
  width: 100%;
  min-height: 42px;
  padding: .58rem .68rem;
  border: 1px solid var(--cbrc-border);
  border-radius: 0;
  background: var(--cbrc-white);
  color: var(--cbrc-ink);
  font: inherit;
}

.cbrc-filter-wide { grid-column: span 2; }
.cbrc-filter-actions { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 0; }
.cbrc-filter-actions button {
  padding: .72rem 1.1rem;
  border: 1px solid var(--cbrc-gold);
  background: var(--cbrc-navy);
  color: var(--cbrc-white);
  cursor: pointer;
}

.cbrc-filter-actions a,
.cbrc-export-links a { color: #76551f; font-weight: 700; }
.cbrc-export-links { display: flex; gap: .8rem; margin: 0; }
.cbrc-results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0; }
.cbrc-results-bar p { margin: 0; }

.cbrc-card-meta {
  margin: 1rem 0;
  padding-top: .8rem;
  border-top: 1px solid var(--cbrc-border);
  font-size: .86rem;
}

.cbrc-card-meta > div { margin: .38rem 0; }
.cbrc-card-meta dt { color: var(--cbrc-muted); font-weight: 700; }
.cbrc-card-meta dd { margin: .08rem 0 0; }

.cbrc-pagination { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.6rem 0; }
.cbrc-pagination .page-numbers {
  display: inline-flex;
  min-width: 2.2rem;
  min-height: 2.2rem;
  align-items: center;
  justify-content: center;
  padding: .35rem .55rem;
  border: 1px solid var(--cbrc-border);
  background: var(--cbrc-white);
  color: var(--cbrc-ink);
}
.cbrc-pagination .current { border-color: var(--cbrc-gold); background: var(--cbrc-navy); color: var(--cbrc-white); }

.cbrc-table-wrap { overflow-x: auto; }
.cbrc-guide-table { width: 100%; border-collapse: collapse; }
.cbrc-guide-table th,
.cbrc-guide-table td { padding: .8rem; border: 1px solid var(--cbrc-border); text-align: left; vertical-align: top; }
.cbrc-guide-table th { background: var(--cbrc-navy); color: var(--cbrc-white); }
.cbrc-label-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--cbrc-border);
}
.cbrc-label-guide > div { padding: 1rem; border-bottom: 1px solid var(--cbrc-border); }
.cbrc-label-guide dt { color: #76551f; font-weight: 700; }
.cbrc-label-guide dd { margin: .3rem 0 0; }

.cbrc-chain,
.cbrc-evidence-controls,
.cbrc-correction-summary,
.cbrc-relationship-columns,
.cbrc-revision-panel { margin: 1.8rem 0; }
.cbrc-chain__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--cbrc-border);
  background: var(--cbrc-white);
}
.cbrc-chain__grid > div { padding: 1rem; border-right: 1px solid var(--cbrc-border); }
.cbrc-chain__grid > div:last-child { border-right: 0; }
.cbrc-chain__grid h3 { margin-top: 0; font-size: 1rem; }
.cbrc-chain__grid ul { margin: 0; padding-left: 1.1rem; }
.cbrc-chain__grid li { margin: .45rem 0; }
.cbrc-chain__grid a span { color: #76551f; font-size: .8rem; font-weight: 700; }

.cbrc-evidence-controls {
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--cbrc-gold);
  background: var(--cbrc-parchment);
}
.cbrc-evidence-controls h2 { margin-top: 0; }
.cbrc-evidence-controls dl { margin-bottom: 0; }
.cbrc-evidence-controls dl > div { margin: .8rem 0; }
.cbrc-evidence-controls dt { font-weight: 700; }
.cbrc-evidence-controls dd { margin: .2rem 0 0; }
.cbrc-relationship-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.cbrc-relationship-columns section { padding: 1rem; border: 1px solid var(--cbrc-border); }
.cbrc-relationship-columns h2 { margin-top: 0; font-size: 1.15rem; }
.cbrc-revision-panel { padding: .9rem 1rem; border: 1px solid var(--cbrc-border); }
.cbrc-revision-panel summary { cursor: pointer; color: #76551f; font-weight: 700; }

.cbrc-unit-list { display: grid; gap: 1rem; }
.cbrc-unit { padding: 1rem 1.2rem; border: 1px solid var(--cbrc-border); border-left: 4px solid var(--cbrc-gold); background: var(--cbrc-white); }
.cbrc-unit h3 { margin: .2rem 0 .5rem; }
.cbrc-unit__control { display: flex; flex-wrap: wrap; gap: .5rem 1rem; color: var(--cbrc-muted); font-size: .86rem; }
.cbrc-unit-detail { margin: 1.5rem 0; padding: 1.2rem; border: 2px solid var(--cbrc-gold); background: var(--cbrc-parchment); }
.cbrc-unit-detail__text { margin: 1.2rem 0; padding: 1rem; background: var(--cbrc-white); }
.cbrc-unit-detail [dir="rtl"] { direction: rtl; text-align: right; }

.cbrc-variant-dossier { margin: 1rem 0 2rem; color: var(--cbrc-ink); }
.cbrc-dossier-intro { margin-bottom: 1.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--cbrc-border); border-left: 5px solid var(--cbrc-gold); background: var(--cbrc-parchment); }
.cbrc-dossier-intro p:last-child { margin-bottom: 0; }
.cbrc-entailment-badge {
  display: inline-flex;
  margin: .15rem 0 .65rem;
  padding: .28rem .68rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.35;
}
.cbrc-entailment-badge--no-adverse { border-color: #8fb8a3; background: #edf7f1; color: #245b42; }
.cbrc-entailment-badge--established { border-color: #c89990; background: #fbefed; color: #7b3028; }
.cbrc-entailment-badge--provisional { border-color: #d0b36e; background: #fff8e6; color: #735719; }
.cbrc-entailment-badge--pending { border-color: #b7bdc6; background: #f2f4f6; color: #4d5663; }
.cbrc-dossier-section { margin: 1.25rem 0; padding: 1.25rem; border: 1px solid var(--cbrc-border); background: var(--cbrc-white); box-shadow: 0 6px 20px rgba(7, 21, 34, .05); }
.cbrc-dossier-section > h2 { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; color: var(--cbrc-navy); font-size: 1.45rem; }
.cbrc-dossier-section > h2 > span { display: inline-flex; width: 2rem; height: 2rem; flex: 0 0 2rem; align-items: center; justify-content: center; border-radius: 50%; background: var(--cbrc-navy); color: var(--cbrc-white); font-size: .9rem; }
.cbrc-dossier-field { margin: 1rem 0; }
.cbrc-dossier-field h3, .cbrc-source-rationale h3 { margin: 0 0 .35rem; color: #76551f; font-size: 1rem; }
.cbrc-dossier-field p { margin: .25rem 0; white-space: pre-line; }
.cbrc-source-rationale { margin: 1rem 0; padding: .9rem 1rem; border-left: 4px solid var(--cbrc-gold); background: var(--cbrc-parchment); }
.cbrc-source-rationale p { margin: .35rem 0; }
.cbrc-source-locator, .cbrc-editorial-caveat { color: var(--cbrc-muted); font-size: .9rem; }
.cbrc-editorial-caveat { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--cbrc-border); }
.cbrc-na29-table { width: 100%; border-collapse: collapse; }
.cbrc-na29-table th, .cbrc-na29-table td { padding: .7rem; border: 1px solid var(--cbrc-border); text-align: left; vertical-align: top; }
.cbrc-na29-table th { background: var(--cbrc-navy); color: var(--cbrc-white); }
.cbrc-four-point { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.cbrc-four-point section { padding: .9rem 1rem; border: 1px solid var(--cbrc-border); background: var(--cbrc-parchment); }
.cbrc-four-point h4 { margin: 0 0 .35rem; color: #76551f; }
.cbrc-four-point p { margin: 0; }
.cbrc-full-essay { margin-top: 1.25rem; border: 1px solid var(--cbrc-border); }
.cbrc-full-essay summary, .cbrc-related-groups summary { cursor: pointer; color: #76551f; font-weight: 700; }
.cbrc-full-essay summary { padding: .9rem 1rem; background: var(--cbrc-parchment); }
.cbrc-full-essay__body { padding: 1rem 1.2rem; }
.cbrc-consulted-sources { margin-top: 1.35rem; padding-top: 1.1rem; border-top: 1px solid var(--cbrc-border); }
.cbrc-source-audit-status { color: var(--cbrc-muted); font-size: .92rem; }
.cbrc-consulted-source { margin: .7rem 0; border: 1px solid var(--cbrc-border); border-radius: .4rem; background: #fbfaf7; }
.cbrc-consulted-source > summary { display: flex; flex-direction: column; gap: .18rem; padding: .8rem 1rem; cursor: pointer; }
.cbrc-consulted-source > summary span { font-weight: 700; }
.cbrc-consulted-source > summary small { color: var(--cbrc-muted); }
.cbrc-consulted-source__body { padding: .9rem 1rem 1rem; border-top: 1px solid var(--cbrc-border); }
.cbrc-consulted-source__body blockquote { margin: 1rem 0; padding: .1rem 0 .1rem 1rem; border-left: 3px solid var(--cbrc-gold); color: #47433c; }
.cbrc-source-open { font-weight: 650; }
.cbrc-logical-entailment {
  margin-top: 1.5rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--cbrc-border);
  border-top: 4px solid var(--cbrc-gold);
  background: #fbfaf7;
}
.cbrc-logical-entailment > h3 { margin: 0 0 .6rem; color: var(--cbrc-navy); font-size: 1.25rem; }
.cbrc-logical-entailment h4 { margin: 1rem 0 .35rem; color: #76551f; font-size: 1rem; }
.cbrc-entailment-standard { color: var(--cbrc-muted); font-size: .92rem; }
.cbrc-entailment-result { padding: .75rem .85rem; border-left: 4px solid var(--cbrc-gold); background: var(--cbrc-parchment); }
.cbrc-entailment-status { margin-bottom: .6rem; }
.cbrc-entailment-chain ol { margin: .4rem 0 0; padding-left: 1.4rem; }
.cbrc-entailment-chain li { margin: .5rem 0; }
.cbrc-entailment-preservation { margin-top: 1rem; padding: .75rem .85rem; border-left: 4px solid #8a4b39; background: #fbefed; }
.cbrc-entailment-preservation h4 { margin-top: 0; color: #7b3028; }
.cbrc-entailment-sources ul { margin: .4rem 0 0; padding-left: 1.25rem; }
.cbrc-entailment-sources li { margin: .5rem 0; }
.cbrc-entailment-sources small { display: block; color: var(--cbrc-muted); font-size: .86rem; }
.cbrc-related-groups { display: grid; gap: .65rem; }
.cbrc-related-groups details { border: 1px solid var(--cbrc-border); }
.cbrc-related-groups summary { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; background: var(--cbrc-parchment); }
.cbrc-related-groups summary span { display: inline-flex; min-width: 1.55rem; height: 1.55rem; align-items: center; justify-content: center; border-radius: 999px; background: var(--cbrc-navy); color: var(--cbrc-white); font-size: .75rem; }
.cbrc-related-groups ul { margin: 0; padding: .75rem 1rem .8rem 2.1rem; }
.cbrc-related-groups li { margin: .5rem 0; }
.cbrc-related-groups small { display: block; color: var(--cbrc-muted); }
.cbrc-related-groups .cbrc-empty { margin: 0; padding: .8rem 1rem; }
.cbrc-source-links { margin: .5rem 0 0; }

.cbrc-method-notice {
  clear: both;
  margin: 1.15rem 0 1.4rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--cbrc-border);
  border-left: 5px solid var(--cbrc-gold);
  background: var(--cbrc-parchment);
}
.cbrc-method-notice__label { margin: 0 0 .2rem; color: #76551f; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cbrc-method-notice h2 { margin: 0 0 .45rem; color: var(--cbrc-navy); font-size: 1.25rem; }
.cbrc-method-notice > p:last-of-type { margin-bottom: .6rem; }
.cbrc-method-notice details { padding-top: .55rem; border-top: 1px solid var(--cbrc-border); }
.cbrc-method-notice summary { cursor: pointer; color: #76551f; font-weight: 700; }
.cbrc-method-notice details p { margin-bottom: 0; }
.cbrc-method-notice--ministerial { border-left-color: #2f6f54; }
.cbrc-method-notice--magisterial { border-left-color: #8a4b39; }
.cbrc-method-notice--mixed-transitional { border-left-color: #8a6b24; }

.cbrc-method-badge {
  display: inline-block;
  margin: 0 0 .55rem;
  padding: .22rem .55rem;
  border: 1px solid #c8b98c;
  border-radius: 999px;
  background: #fbf7e9;
  color: #4c401f;
  font-size: .78rem;
  line-height: 1.35;
}

.cbrc-filters input:focus,
.cbrc-filters select:focus,
.cbrc-filter-actions button:focus,
.cbrc-pagination a:focus {
  outline: 3px solid var(--cbrc-gold-light);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .cbrc-search, .cbrc-form-row { display: grid; grid-template-columns: 1fr; }
  .cbrc-record-control { grid-template-columns: 1fr 1fr; }
  .cbrc-filter-grid,
  .cbrc-label-guide,
  .cbrc-chain__grid,
  .cbrc-relationship-columns,
  .cbrc-four-point { grid-template-columns: 1fr; }
  .cbrc-filter-wide { grid-column: auto; }
  .cbrc-chain__grid > div { border-right: 0; border-bottom: 1px solid var(--cbrc-border); }
  .cbrc-chain__grid > div:last-child { border-bottom: 0; }
  .cbrc-results-bar { align-items: flex-start; flex-direction: column; }
  .cbrc-person-portrait--record { float: none; width: 100%; max-width: 360px; margin: 0 auto 1.25rem; }
}

@media (min-width: 641px) and (max-width: 980px) {
  .cbrc-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
