:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #151817;
  background: #f7f6f2;
  --ink: #151817;
  --muted: #6d716f;
  --line: #dedbd3;
  --line-strong: #c6c1b7;
  --panel: #ffffff;
  --paper: #fbfaf7;
  --header: #111b19;
  --accent: #2f6058;
  --accent-strong: #244c46;
  --mark: #f0dc91;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f7f6f2;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f7f6f2;
  overflow-x: hidden;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 32px;
  color: #f4f3ef;
  background: var(--header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.appbar-brand {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.appbar-brand div {
  display: grid;
  gap: 3px;
}

.appbar-brand strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.appbar-brand span:not(.brand-mark) {
  display: none;
}

.appbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.appbar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: rgba(244, 243, 239, 0.84);
  font-size: 14px;
  font-weight: 800;
}

.appbar-links a:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100vw - 48px));
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 64px;
}

.detail-shell {
  max-width: 1120px;
}

.topbar {
  display: block;
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 0 10px;
  text-align: center;
  border-bottom: 0;
}

.topbar > div {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: min(980px, 100%);
  margin-bottom: 0;
  color: #101413;
  font-size: 34px;
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2,
h3 {
  letter-spacing: 0;
}

.subhead {
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.mobile-title,
.mobile-title-break {
  display: none;
}

.desktop-title {
  display: inline;
}

.corpus-badge,
.rank {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: #eef4f2;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.notice {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid #d7bf5b;
  color: #5f4a08;
  background: #fff8d9;
}

.search-panel {
  display: grid;
  gap: 12px;
  max-width: 980px;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #3c4542;
  font-size: 12px;
  font-weight: 900;
}

input,
select,
button,
.button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
  background: #ffffff;
}

input,
select {
  font-size: 14px;
  font-weight: 650;
}

input:focus,
select:focus {
  outline: 2px solid rgba(47, 96, 88, 0.18);
  border-color: var(--accent);
  background: #ffffff;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  min-width: 0;
}

.query input {
  min-height: 56px;
  padding: 14px 16px;
  border-color: #9da59f;
  font-size: 20px;
}

button,
.button {
  display: inline-grid;
  place-items: center;
  min-height: 56px;
  cursor: pointer;
  font-weight: 900;
}

button {
  border-color: var(--accent-strong);
  color: #ffffff;
  background: var(--accent-strong);
}

button:hover {
  background: #193834;
}

button:disabled,
.is-loading button {
  cursor: progress;
  opacity: 0.72;
}

.ghost-button {
  color: var(--accent-strong);
  background: #ffffff;
}

.ghost-button:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.filters {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.primary-filters {
  grid-template-columns: 1.55fr 1.25fr 0.95fr 0.95fr 1fr 1fr;
}

.filters-drawer {
  padding-top: 0;
}

.filters-drawer summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.filters-drawer[open] summary {
  margin-bottom: 10px;
}

.secondary-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.workspace {
  margin-top: 18px;
}

.results-heading h2 {
  margin-bottom: 0;
  color: #101413;
  font-size: 18px;
  line-height: 1.2;
}

.results-heading,
.result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.active-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.active-strip > span {
  display: none;
}

.active-strip strong {
  color: var(--ink);
}

.active-chips {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.active-chips a,
.clear-all {
  padding: 3px 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font-weight: 850;
}

.active-chips a:hover,
.clear-all:hover {
  text-decoration: none;
}

.results-area {
  position: relative;
  min-width: 0;
  max-width: 100%;
  transition: opacity 140ms ease;
}

.is-searching .results-area {
  opacity: 0.58;
}

.results-heading {
  align-items: center;
  margin-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.results {
  display: grid;
  counter-reset: result;
  min-width: 0;
  max-width: 100%;
}

.result {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  padding: 20px 0 20px 44px;
  border-bottom: 1px solid var(--line);
  transition: background 120ms ease;
}

.result::before {
  counter-increment: result;
  content: counter(result);
  position: absolute;
  top: 19px;
  left: 0;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--accent-strong);
  background: #e8efed;
  font-size: 12px;
  font-weight: 900;
}

.result:hover {
  background: rgba(255, 255, 255, 0.7);
}

.result h3 {
  margin-bottom: 0;
  color: #102d42;
  font-size: 18px;
  line-height: 1.32;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.result h3 a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-main {
  min-width: 0;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 10px;
  min-width: 0;
}

.case-meta span,
.match-list span,
.result-side span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: #47504d;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.snippet {
  max-width: 880px;
  margin-bottom: 0;
  color: #303734;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

mark {
  padding: 0 2px;
  color: #211c08;
  background: var(--mark);
}

.match-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.result-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.result-side a {
  margin-top: auto;
  padding: 8px 10px;
  border: 1px solid var(--accent-strong);
  color: #ffffff;
  background: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.result-side a:hover {
  background: #193834;
  text-decoration: none;
}

.empty {
  display: grid;
  gap: 5px;
  padding: 30px 0;
  color: var(--muted);
  border-bottom: 1px dashed var(--line-strong);
}

.empty strong {
  color: var(--ink);
  font-size: 18px;
}

.pagination {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.pagination a,
.back {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  color: var(--accent-strong);
  background: #ffffff;
  font-weight: 900;
}

.pagination a:hover,
.back:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.back {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  margin-bottom: 14px;
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 20px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-grid div {
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.document-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.lead-section {
  border-top: 2px solid var(--accent);
}

.document-section h2 {
  margin-bottom: 12px;
  color: #101413;
  font-size: 22px;
}

.document-section p,
.case-text {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.case-text {
  max-width: 920px;
  color: #202623;
  font-size: 16px;
  line-height: 1.74;
}

@media (max-width: 1100px) {
  .appbar {
    position: static;
    width: auto;
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
  }

  .appbar-brand {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .appbar-links {
    display: flex;
    flex-wrap: wrap;
  }

  .appbar-links a {
    border-bottom: 0;
  }

  .shell {
    margin-left: 0;
  }

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

}

@media (max-width: 760px) {
  .shell {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin: 0 auto;
    padding: 20px 0 44px;
  }

  .appbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 14px;
    overflow: hidden;
  }

  .appbar-links {
    width: 100%;
  }

  .topbar,
  .query-row,
  .primary-filters,
  .secondary-filters,
  .result,
  .result-title-row,
  .results-heading,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
    max-width: 100%;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title,
  .mobile-title-break {
    display: block;
  }

  .subhead {
    max-width: 30ch;
    font-size: 14px;
    overflow-wrap: break-word;
  }

  .topbar {
    gap: 12px;
    padding-bottom: 16px;
    width: 100%;
    text-align: left;
  }

  .corpus-badge {
    display: none;
  }

  .query input,
  button,
  .button {
    min-height: 50px;
  }

  .search-panel {
    width: 100%;
    max-width: 100%;
    margin-top: 14px;
    padding: 0;
    box-shadow: none;
  }

  .result {
    width: 100%;
    padding-left: 0;
    padding-top: 42px;
    overflow: hidden;
  }

  .result::before {
    top: 12px;
  }

  .result-side {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .result-side a {
    margin-top: 0;
  }

  .active-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .corpus-badge,
  .result-count,
  .rank {
    width: fit-content;
  }
}
