:root {
  --ink: #201b1d;
  --text: #2d292b;
  --muted: #71686b;
  --line: #d8d1cb;
  --hairline: #ebe6e1;
  --paper: #fffdfa;
  --bg: #f5f2ee;
  --panel: #ffffff;
  --accent: #8a1f2d;
  --accent-dark: #681620;
  --accent-soft: #f7e8ea;
  --blue: #284f6f;
  --green: #476b55;
  --gold: #b0832f;
  --mark: #fff0a8;
  --focus: #1a6c8c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(138, 31, 45, .045) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 52px 52px;
  color: var(--text);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

main {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 54px;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0 16px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border: 2px solid var(--gold);
  color: #fff;
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 800;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 0;
}

.brand small,
.toplinks,
p {
  color: var(--muted);
}

.toplinks {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 12px;
}

.toplinks a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.toplinks a:hover { text-decoration: underline; }

.case-finder {
  background:
    linear-gradient(135deg, rgba(138, 31, 45, .22), transparent 44%),
    var(--ink);
  border: 1px solid #3c3336;
  color: #fff;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
  margin: 20px 0 14px;
  padding: clamp(20px, 4vw, 38px);
  position: relative;
}

.case-finder::before {
  content: "";
  background: var(--accent);
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
  width: 7px;
}

.finder-copy,
.finder-tools {
  position: relative;
}

.kicker {
  color: #e0c68d;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.kicker.dark {
  color: var(--accent-dark);
  margin-bottom: 6px;
}

h1 {
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 0 12px;
  max-width: 850px;
}

p {
  line-height: 1.55;
  margin: 0;
}

.case-finder p {
  color: #ded7d0;
  max-width: 660px;
}

.searchbar {
  background: #fff;
  border: 1px solid #a99b91;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
  display: grid;
  gap: 0;
  grid-template-columns: 1fr auto;
  padding: 6px;
}

input,
select,
button {
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

input,
select {
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 0 11px;
}

.searchbar input {
  border: 0;
  font-size: 17px;
  min-height: 52px;
}

.search-help {
  color: #cfc5bd;
  font-size: 13px;
  margin-top: 8px;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

button:hover { background: var(--accent-dark); }
button:disabled { cursor: not-allowed; opacity: .5; }
input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(26, 108, 140, .22);
  outline-offset: 2px;
}

.quick-searches,
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-searches {
  margin-top: 12px;
}

.active-filters {
  margin-top: 12px;
}

.active-filters:empty { display: none; }

.quick-searches button,
.active-filters button,
.facet-list button,
#reset {
  background: transparent;
  border-color: rgba(255, 255, 255, .24);
  color: #f4ede8;
  min-height: 34px;
}

.quick-searches button {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .28);
}

.active-filters button {
  background: rgba(138, 31, 45, .35);
}

.quick-searches button:hover,
.active-filters button:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .45);
}

.stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 18px;
}

.stats div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  box-shadow: 0 8px 20px rgba(32, 27, 29, .05);
  padding: 13px 15px;
}

.topic-board {
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  padding: 16px;
}

.topic-board-head {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.topic-board h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.1;
  margin: 0;
}

.filter-toggle {
  background: #f1f5f7;
  border-color: #c6d5dc;
  color: var(--blue);
  min-width: 120px;
}

.filter-toggle:hover {
  background: #e2edf2;
  border-color: #aac4d0;
  color: #17384f;
}

.topic-groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.topic-group {
  background: #fbf9f6;
  border: 1px solid var(--hairline);
  display: grid;
  gap: 8px;
  padding: 10px;
}

.topic-group h3 {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
}

.topic-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-group button {
  background: #fff;
  border-color: #d9cec4;
  color: #342b2e;
  font-size: 12px;
  min-height: 32px;
  padding: 0 9px;
}

.topic-group button:hover {
  background: var(--accent-soft);
  border-color: #d6a5ab;
  color: var(--accent-dark);
}

.stats strong {
  color: var(--ink);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 5px;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 330px 1fr;
}

.sidebar,
.panel,
.decision-card,
.detail {
  background: var(--paper);
  border: 1px solid var(--line);
}

.sidebar {
  border-top: 4px solid var(--ink);
  box-shadow: 0 8px 24px rgba(32, 27, 29, .05);
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 15px;
  position: sticky;
  top: 14px;
}

.sidebar-head,
.head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sidebar h2,
.head h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  margin: 0;
}

#reset {
  border-color: var(--line);
  color: var(--accent-dark);
  font-size: 13px;
  padding: 0 10px;
}

#reset:hover,
.facet-list button:hover {
  background: var(--accent-soft);
  border-color: #d5a9ae;
}

.filters {
  display: grid;
  gap: 11px;
  margin: 14px 0;
}

.wide-filter {
  background: #fff8ea;
  border: 1px solid #e3d2a6;
  margin: -2px 0 2px;
  padding: 10px;
}

.filters label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
}

.filters input,
.filters select {
  border-color: var(--line);
  min-height: 39px;
}

.filters select,
.filters input {
  width: 100%;
}

.filters .checkline {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  gap: 8px;
  min-height: 40px;
}

.checkline input {
  height: 16px;
  min-height: auto;
  width: 16px;
}

.date-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.insights {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  padding-top: 14px;
}

.insights h3 {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
}

.insights p {
  font-size: 13px;
}

.facet-list {
  display: grid;
  gap: 7px;
}

.facet-list button {
  align-items: center;
  border-color: var(--line);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  text-align: left;
}

.lawyer-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
}

.panel-title {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.panel-title h2 {
  font-size: 16px;
}

.panel-title select {
  min-height: 32px;
  max-width: 132px;
}

.lawyer-stats {
  display: grid;
  gap: 7px;
}

.lawyer-row {
  align-items: center;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 7px 9px;
  text-align: left;
}

.lawyer-row:hover {
  background: var(--accent-soft);
  border-color: #d7aab0;
}

.lawyer-row strong,
.lawyer-row small {
  display: block;
}

.lawyer-row small,
.small-muted {
  color: var(--muted);
  font-size: 12px;
}

.lawyer-row em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 900;
}

.lawyer-detail {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  display: grid;
  gap: 10px;
  padding: 18px;
}

.lawyer-detail h2 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0;
}

.lawyer-detail dl {
  display: grid;
  gap: 6px 16px;
  grid-template-columns: 160px 1fr;
  margin: 0;
}

.lawyer-detail dt {
  color: var(--muted);
  font-weight: 800;
}

.lawyer-detail dd {
  margin: 0;
}

.content {
  min-width: 0;
}

.head {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  margin-bottom: 10px;
  padding: 13px 15px;
}

.head span {
  color: var(--muted);
  font-size: 14px;
}

.results {
  display: grid;
  gap: 10px;
}

.panel,
.decision-card,
.detail {
  padding: 18px;
}

.muted-panel { color: var(--muted); }

.decision-card {
  display: grid;
  gap: 12px;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.decision-card:hover {
  border-color: #c8bbb1;
  box-shadow: 0 10px 28px rgba(32, 27, 29, .07);
}

.decision-card::before {
  background: var(--hairline);
  bottom: 12px;
  content: "";
  left: 58px;
  position: absolute;
  top: 12px;
  width: 1px;
}

.decision-topline {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  position: relative;
}

.decision-link {
  color: var(--ink);
  display: inline-flex;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
  text-decoration: none;
}

.decision-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.rank {
  color: var(--accent);
  flex: 0 0 38px;
  font-family: "Segoe UI", Inter, sans-serif;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-left: 48px;
}

.badge,
.court-badge {
  background: var(--accent-soft);
  border: 1px solid #d7aab0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.badge.neutral,
.court-badge {
  background: #f1f3f5;
  border-color: #d6dce0;
  color: var(--blue);
}

.block,
.keywords,
.detail-section {
  display: grid;
  gap: 5px;
  padding-left: 48px;
}

.block h3,
.keywords h3,
.detail-section h3,
.detail-section h2 {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .04em;
  margin: 0;
  text-transform: uppercase;
}

.block p,
.keywords p,
.detail-section p {
  color: #3c3638;
  line-height: 1.58;
}

.excerpt {
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}

.passage-link {
  color: #3c3638;
  display: block;
  text-decoration: none;
}

.passage-link:hover {
  background: #fffaf0;
  color: var(--ink);
}

.passage-link span,
.passage-note {
  color: var(--accent-dark);
  font-family: "Segoe UI", Inter, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.passage-link span {
  white-space: nowrap;
}

mark {
  background: var(--mark);
  color: inherit;
  padding: 0 2px;
}

mark.current-hit {
  background: #ffd86a;
  box-shadow: 0 0 0 3px rgba(255, 216, 106, .45);
}

.keywords p,
.keyword-line {
  font-size: 14px;
}

.social-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.social-keywords button {
  background: #fff8ea;
  border-color: #dbc28a;
  color: #4e3b13;
  font-size: 12px;
  min-height: 30px;
  padding: 0 9px;
}

.social-keywords button:hover {
  background: #f3e2b9;
  border-color: #c79d3d;
}

.pagination {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 10px;
}

.pagination button {
  min-height: 38px;
}

.pagination span {
  color: var(--muted);
  font-size: 14px;
}

.detail {
  display: grid;
  gap: 18px;
}

.detail h1,
.detail h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 4vw, 40px);
  line-height: 1.15;
  margin: 0;
}

.detail .badges,
.detail .detail-section {
  padding-left: 0;
}

.back {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

.facts {
  display: grid;
  gap: 8px 18px;
  grid-template-columns: minmax(160px, 240px) 1fr;
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-weight: 800;
}

.facts dd {
  color: #2c282a;
  margin: 0;
}

.summary-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.summary-item strong {
  display: block;
  margin-bottom: 5px;
}

.full-text {
  background: #fff;
  border: 1px solid var(--line);
  color: #252122;
  font: 15px/1.58 Georgia, "Times New Roman", serif;
  margin: 0;
  max-height: 70vh;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
}

.seo-content {
  max-width: 980px;
}

@media (max-width: 1040px) {
  .case-finder,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topic-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    max-height: none;
    position: static;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  main {
    width: min(100% - 22px, 1360px);
    padding-top: 12px;
  }

  .topbar,
  .decision-topline,
  .head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toplinks {
    display: none;
  }

  .case-finder {
    gap: 18px;
    padding: 20px 18px;
  }

  h1 {
    font-size: 35px;
  }

  .stats,
  .searchbar,
  .filters,
  .date-grid,
  .topic-groups {
    grid-template-columns: 1fr;
  }

  .topic-board {
    padding: 12px;
  }

  .topic-board-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topic-group {
    padding: 9px;
  }

  .topic-group div,
  .quick-searches,
  .social-keywords {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .topic-group button,
  .quick-searches button,
  .social-keywords button {
    flex: 0 0 auto;
  }

  .searchbar {
    gap: 6px;
  }

  .searchbar input {
    border: 1px solid var(--line);
  }

  .panel,
  .decision-card,
  .detail,
  .sidebar {
    padding: 14px;
  }

  .sidebar.is-collapsed {
    display: none;
  }

  .decision-card::before {
    display: none;
  }

  .rank {
    flex-basis: auto;
    text-align: left;
  }

  .decision-link {
    font-size: 17px;
  }

  .badges,
  .block,
  .keywords {
    padding-left: 0;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .facts dd {
    margin-bottom: 8px;
  }
}
