:root {
  color-scheme: light;
  --ink: #172034;
  --ink-soft: #4e5869;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --line: #d9d4c8;
  --gold: #9b742d;
  --gold-soft: #efe4ca;
  --green: #1f6b63;
  --green-soft: #dcece8;
  --danger: #9d3131;
  --shadow: 0 18px 50px rgba(23, 32, 52, 0.1);
}

* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.72), transparent 28rem), var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  color: white;
  background: var(--ink);
  border-radius: 8px;
}
.skip-link:focus {
  top: 1rem;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: .8rem clamp(1rem, 4vw, 3.5rem);
  background: rgba(255,253,248,.94);
  border-bottom: 1px solid rgba(217,212,200,.9);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  display: grid;
  line-height: 1.05;
}
.brand strong {
  font: 600 1.35rem/1 Georgia, "Times New Roman", serif;
  letter-spacing: -.02em;
}
.brand small {
  margin-top: .28rem;
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.account-actions,
.reader-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.reader-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.account-email {
  max-width: 18rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}
.workspace {
  padding: clamp(2.25rem, 6vw, 5rem) 0 5rem;
}
.workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2rem;
  margin-bottom: 2rem;
}
.eyebrow {
  margin: 0 0 .5rem;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
}
h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.35rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.03;
}
.lede {
  max-width: 66ch;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.15rem);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}
.status-badge::before {
  width: .55rem;
  height: .55rem;
  background: currentColor;
  border-radius: 50%;
  content: "";
}
.status-ready {
  color: var(--green);
  border-color: #b6d9d2;
  background: var(--green-soft);
}
.status-empty {
  color: #725722;
  border-color: #ddcca4;
  background: var(--gold-soft);
}

.search-form {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.search-form > label {
  display: block;
  margin-bottom: .65rem;
  color: #f7f3e8;
  font-size: .85rem;
  font-weight: 750;
}
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
}
input,
select {
  width: 100%;
  min-height: 48px;
  padding: .78rem .95rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}
input:focus,
select:focus {
  border-color: #c89d4d;
  box-shadow: 0 0 0 3px rgba(200,157,77,.22);
}
.form-note {
  margin: .75rem 0 0;
  color: #c9cfda;
  font-size: .78rem;
}
.button {
  min-height: 42px;
  padding: .65rem .95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 760;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.button:hover:not(:disabled) {
  transform: translateY(-1px);
}
.button:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(181,138,54,.35);
  outline-offset: 2px;
}
.button:disabled {
  cursor: wait;
  opacity: .66;
}
.button-primary {
  color: #fffdf8;
  background: var(--green);
  border-color: var(--green);
}
.button-primary:hover:not(:disabled) {
  background: #195d56;
}
.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
.button-quiet {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}
.button-full {
  width: 100%;
  margin-top: .4rem;
}
.notice {
  margin-top: 1rem;
  padding: .9rem 1rem;
  color: #654d1d;
  background: var(--gold-soft);
  border: 1px solid #ddcca4;
  border-radius: 9px;
}

.results-section {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}
.results-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
}
.results-heading-row h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 600;
}
.result-count {
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 700;
}
.results-heading-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}
.results {
  display: grid;
  gap: 1rem;
}
.empty-state {
  display: grid;
  gap: .35rem;
  padding: 2rem;
  color: var(--ink-soft);
  text-align: center;
  background: rgba(255,253,248,.65);
  border: 1px dashed #c9c2b3;
  border-radius: 12px;
}
.empty-state strong {
  color: var(--ink);
  font: 600 1.1rem/1.3 Georgia, "Times New Roman", serif;
}
.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  padding: clamp(1.1rem, 3vw, 1.55rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
}
.result-card h3 {
  margin: .35rem 0 .8rem;
  font-size: 1.3rem;
  font-weight: 600;
}
.case-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: .8rem;
}
.match-relation {
  display: inline-flex;
  width: fit-content;
  margin: .65rem 0 0;
  padding: .28rem .52rem;
  color: #31566e;
  background: #e8f1f6;
  border: 1px solid #bfd3df;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .025em;
}
.match-CITED_CASE {
  color: #654d1d;
  background: var(--gold-soft);
  border-color: #ddcca4;
}
.match-CITING_JUDGMENT {
  color: var(--green);
  background: var(--green-soft);
  border-color: #b6d9d2;
}
.passage {
  margin: .8rem 0;
  padding: .9rem 1rem;
  color: #273044;
  background: #f7f4ec;
  border-left: 2px solid #c9b98f;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
  white-space: pre-wrap;
}
.passage mark,
.result-card h3 mark,
.case-meta mark,
.judgment-text mark {
  padding: .04em .12em;
  color: inherit;
  background: #ffe18a;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.passage mark,
.judgment-text mark {
  box-shadow: inset 0 -1px 0 #d0a83c;
}
.judgment-text mark.current-reader-match {
  background: #ffc94d;
  outline: 2px solid rgba(155, 116, 45, .35);
  scroll-margin-top: 155px;
}
.provenance {
  margin: 0;
  color: var(--ink-soft);
  font-size: .75rem;
}
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: .55rem;
  min-width: 9.5rem;
}

.reader {
  padding: 1.25rem 0 5rem;
}
.reader-toolbar {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -.5rem;
  padding: .7rem .5rem;
  background: rgba(244,241,233,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.match-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  color: var(--ink-soft);
}
.match-count {
  min-width: 5.5rem;
  text-align: center;
  font-size: .76rem;
  font-weight: 750;
}
.judgment-header {
  max-width: 820px;
  margin: 3rem auto 2rem;
}
.judgment-header h1 {
  max-width: none;
  font-size: clamp(2rem, 5vw, 3.45rem);
}
.judgment-meta {
  color: var(--ink-soft);
}
.source-assurance {
  margin-top: 1.3rem;
  padding: .85rem 1rem;
  color: #654d1d;
  background: var(--gold-soft);
  border: 1px solid #ddcca4;
  border-radius: 8px;
  font-size: .84rem;
}
.judgment-pages {
  display: grid;
  gap: 1.25rem;
  max-width: 820px;
  margin: 0 auto;
}
.judgment-page {
  scroll-margin-top: 150px;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(23,32,52,.06);
}
.judgment-page.target-page {
  border-color: #c8a65e;
  box-shadow: 0 0 0 3px rgba(155, 116, 45, .12), 0 14px 36px rgba(23,32,52,.1);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.page-heading strong {
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.target-page-label {
  display: inline-flex;
  margin-left: .35rem;
  padding: .2rem .42rem;
  color: #654d1d;
  background: var(--gold-soft);
  border-radius: 999px;
  font-size: .64rem;
  letter-spacing: .035em;
  vertical-align: middle;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}
.judgment-text {
  margin: 0;
  color: #1d2433;
  font-family: Georgia, "Noto Serif Bengali", "Times New Roman", serif;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  line-height: 1.85;
  white-space: pre-wrap;
}
.page-hash {
  margin: 1.25rem 0 0;
  color: #747b88;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .68rem;
}

footer {
  padding: 1.8rem 1rem 2.5rem;
  color: var(--ink-soft);
  text-align: center;
  border-top: 1px solid var(--line);
  font-size: .78rem;
}
footer p {
  max-width: 72ch;
  margin: 0 auto;
}
.auth-dialog {
  width: min(440px, calc(100% - 2rem));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(13,20,35,.28);
}
.auth-dialog::backdrop {
  background: rgba(15,22,36,.65);
  backdrop-filter: blur(4px);
}
.auth-form {
  display: grid;
  gap: .7rem;
  padding: 1.5rem;
}
.auth-form h2 {
  margin: 0;
  font-size: 1.65rem;
}
.auth-form > p {
  margin: 0 0 .5rem;
  color: var(--ink-soft);
  font-size: .88rem;
}
.auth-form label {
  font-size: .8rem;
  font-weight: 750;
}
.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.icon-button {
  width: 36px;
  height: 36px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}
.form-error {
  padding: .7rem;
  color: var(--danger) !important;
  background: #f7e7e7;
  border-radius: 7px;
}
.dialog-note {
  margin: .3rem 0 0 !important;
  text-align: center;
  font-size: .75rem !important;
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
  }
  .account-email {
    display: none;
  }
  .workspace-heading,
  .result-card {
    grid-template-columns: 1fr;
  }
  .workspace-heading {
    gap: 1rem;
  }
  .status-badge {
    justify-self: start;
  }
  .search-row {
    grid-template-columns: 1fr;
  }
  .results-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .results-heading-actions {
    align-items: flex-start;
  }
  .result-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
  }
  .result-actions .button {
    flex: 1 1 auto;
  }
  .reader-toolbar {
    top: 64px;
  }
  .match-navigation {
    order: 3;
    flex: 1 0 100%;
  }
  .reader-actions {
    gap: .3rem;
  }
  .reader-actions .button {
    padding-inline: .65rem;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-actions {
    justify-content: flex-start;
  }
}

@media print {
  body {
    background: white;
  }
  .topbar,
  .reader-toolbar,
  footer,
  .source-assurance,
  .page-heading .button {
    display: none !important;
  }
  main,
  .judgment-pages,
  .judgment-header {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .reader {
    padding: 0;
  }
  .judgment-page {
    break-inside: avoid;
    padding: 1rem 0;
    border: 0;
    box-shadow: none;
  }
}

.judgment-result-group {
  display: grid;
  gap: .65rem;
}
.passage-role {
  margin: 0 0 .2rem;
  color: #6b5520;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.additional-passages {
  padding: .7rem;
  background: rgba(247,244,236,.7);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.additional-passages summary {
  cursor: pointer;
  color: #31566e;
  font-size: .82rem;
  font-weight: 800;
}
.additional-passages-list {
  display: grid;
  gap: .65rem;
  margin-top: .7rem;
}
.additional-passages .result-card {
  border-left-color: #8fa7b5;
}

.search-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}
.search-options label {
  display: grid;
  gap: .35rem;
  color: #f7f3e8;
  font-size: .76rem;
  font-weight: 750;
}
@media (max-width: 720px) {
  .search-options {
    grid-template-columns: 1fr;
  }
}

.load-more-results {
  display: flex;
  justify-content: center;
  padding: .6rem 0;
}
:root { --research-border: #c8d1de; }
.research-disclosure { margin: 1.5rem 0; border: 1px solid var(--research-border); border-radius: .75rem; padding: 1rem; }
.research-disclosure summary { cursor: pointer; font-weight: 600; font-size: 1rem; }
.research-panel { padding-top: 1rem; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.research-panel textarea { display: block; width: 100%; box-sizing: border-box; font: inherit; padding: .75rem; border: 1px solid var(--research-border); border-radius: .5rem; }
.research-panel label { display: block; font-weight: 600; margin-bottom: .5rem; }
.research-source-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.research-authority { padding: 1rem; margin: 1rem 0; border-left: 3px solid #365681; background: #f3f6fa; }
.research-authority h4 { margin: .5rem 0; }
.research-authority blockquote, .research-source-text { white-space: pre-wrap; margin: .75rem 0; }
.research-panel :focus-visible { outline: 3px solid #365681; outline-offset: 3px; }

/* Quiet search workspace, shared across desktop and mobile web. */
:root { --paper:#fafaf9; --surface:#ffffff; --line:#e3e5e3; --ink:#202824; --ink-soft:#66716b; --shadow:0 4px 24px rgba(20,40,30,.04); }
body { background:var(--paper); }
.topbar { background:rgba(250,250,249,.96); border-bottom:0; }
.brand strong { font-family:inherit; font-size:1.2rem; }
.brand small { font-size:.7rem; font-weight:500; letter-spacing:0; text-transform:none; }
.workspace { max-width:780px; margin:auto; padding:clamp(4rem,17vh,10rem) 0 3rem; min-height:calc(100svh - 150px); }
.workspace-heading { display:block; text-align:center; margin-bottom:2rem; }
.workspace-heading h1 { max-width:none; font-family:inherit; font-size:clamp(1.75rem,4vw,2.5rem); line-height:1.2; font-weight:500; letter-spacing:-.04em; }
#corpus-badge { margin-top:1rem; font-weight:500; white-space:normal; }
#corpus-badge.status-ready { display:none; }
.search-form { padding:1rem; background:var(--surface); border:1px solid var(--line); border-radius:24px; box-shadow:var(--shadow); }
.search-form:focus-within { border-color:#83a49a; }
.search-row { display:grid; grid-template-columns:minmax(0,1fr) 48px; align-items:center; gap:.5rem; }
#search-query { border:0; background:transparent; box-shadow:none; min-width:0; padding:.7rem .5rem; font-size:1rem; }
#search-button { width:48px; height:48px; min-height:48px; padding:0; border-radius:50%; font-size:1.6rem; }
.search-filters { margin-top:.5rem; }
.search-filters summary { width:fit-content; padding:.35rem .6rem; cursor:pointer; color:var(--ink-soft); font-size:.875rem; border-radius:8px; }
.search-options label { color:var(--ink-soft); font-size:.875rem; font-weight:500; }
.search-options select { font-size:.875rem; }
.research-disclosure { margin:1rem 0; padding:.6rem 1rem; border:0; }
.research-disclosure > summary { color:var(--ink-soft); font-size:.875rem; font-weight:500; text-align:center; }
.research-disclosure[open] { background:white; border:1px solid var(--line); border-radius:18px; }
.research-panel h2,.results-section h2 { font-family:inherit; font-size:1.25rem; }
.workspace:not(.has-search) .results-section { display:none; }
.workspace.has-search { padding-top:2rem; }
.workspace.has-search .workspace-heading { display:none; }
.results-section { margin-top:2rem; }
.result-card { box-shadow:none; border-radius:16px; }
footer { border:0; text-align:center; padding:1rem; color:var(--ink-soft); font-size:.8rem; }
footer details { max-width:650px; margin:auto; }
footer summary { cursor:pointer; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:600px) { .workspace { padding-top:14vh; } .search-form { padding:.75rem; } .account-email { max-width:8rem; } .results-heading-row { align-items:start; flex-wrap:wrap; } }

/* Search passages reflow across the full card width; source line endings are not layout. */
.result-card { grid-template-columns:minmax(0,1fr); }
.result-card > div { min-width:0; }
.result-actions { flex-direction:row; flex-wrap:wrap; justify-content:flex-start; }
.passage { white-space:normal; text-align:justify; text-align-last:start; overflow-wrap:anywhere; font-size:1rem; }
.passage p { margin:0 0 1em; white-space:normal; }
.passage p:last-child { margin-bottom:0; }
.result-card h3,.case-meta { overflow-wrap:anywhere; }
.case-citation { display:table; max-width:100%; margin:.65rem 0 .8rem; padding:.55rem .8rem; border:1px solid #bad2ca; border-radius:8px; background:#eaf3ef; color:#174c3c; font-size:1.125rem; font-weight:750; line-height:1.5; overflow-wrap:anywhere; }
.case-citation mark { background:#ffe18a; color:inherit; }
.search-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:.85rem; margin-top:1rem; }
.search-actions .button { min-height:48px; flex:1 1 0; min-width:0; }
.search-actions .button-platinum {
  flex-basis: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(135deg,#fff,#f8fafc,#e2e8f0); color: #0f172a;
  font-size: 15px; font-weight: 600; letter-spacing: -.025em;
  box-shadow: 0 0 0 1px rgba(56,189,248,.45), inset 0 1px 1px #fff, inset 0 -1px 2px rgba(148,163,184,.2), 0 0 16px 2px rgba(56,189,248,.5), 0 0 30px 5px rgba(20,184,166,.3);
  transition: box-shadow .2s, transform .2s;
  flex-wrap: wrap;
}
.button-platinum .ai-search-icon { width:26px; height:26px; object-fit:contain; flex-shrink:0; }
.platinum-badge {
  display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px;
  font-size:10px; font-weight:800; letter-spacing:.05em; white-space:nowrap;
  color:#38bdf8; background:#020617; border:1px solid rgba(56,189,248,.3);
  box-shadow:0 1px 2px rgba(0,0,0,.1);
}
@media (hover:hover) {
  .search-actions .button-platinum:hover {
    transform:translateY(-2px);
    box-shadow:0 0 0 1px rgba(56,189,248,.65), inset 0 1px 1px #fff, 0 0 20px 3px rgba(56,189,248,.6), 0 0 34px 6px rgba(20,184,166,.4);
  }
}
.search-actions .button-platinum:active { transform:translateY(0); }
.search-actions .button-platinum:focus-visible { outline:3px solid #0e7490; outline-offset:4px; }
@media (prefers-reduced-motion:reduce) { .search-actions .button-platinum { transition:none; transform:none; } }
.search-form .search-row { grid-template-columns:minmax(0,1fr); }
.ai-plan-status { padding:.8rem; border-radius:10px; background:#eaf3ef; color:#174c3c; }
.ai-access-context { font-weight:650; overflow-wrap:anywhere; }
.auth-dialog { max-height:calc(100svh - 2rem); overflow-y:auto; }
.search-row { grid-template-columns:minmax(0,1fr) auto; }
#search-button { width:100%; height:auto; min-width:0; padding:14px 12px; border-radius:14px; font-size:1rem; }
.research-panel .form-note { color:var(--ink-soft); font-size:.875rem; }
@media(max-width:600px) {
  .workspace { padding-top:clamp(2rem,7svh,4rem); }
  .workspace-heading { margin-bottom:1.5rem; }
  .workspace-heading h1 { max-width:18ch; margin-inline:auto; }
  .search-row { grid-template-columns:minmax(0,1fr); gap:.5rem; }
  #search-query { width:100%; }
  #search-button { justify-self:end; min-height:48px; }
  .research-source-actions { gap:.5rem; }
  .research-source-actions .button { min-height:48px; }
}
.research-authority blockquote,.research-source-text { white-space:normal; text-align:justify; }
@media(max-width:720px) { .result-card { padding:1rem; } .passage { padding:.8rem; } }

.case-brief-dialog { width:min(760px,calc(100vw - 2rem)); max-width:760px; }
.case-brief-content { overflow-wrap:anywhere; line-height:1.75; }
.case-brief-content p { white-space:pre-line; margin:0 0 1rem; }
.case-brief-content h3 { margin:1.5rem 0 .5rem; font-size:1.1rem; color:var(--ink); }
.case-brief-content:empty { display:none; }
@media(max-width:600px) { .case-brief-dialog { width:calc(100vw - 1rem); max-height:calc(100svh - 1rem); } }

/* Compact workbook provisions: continuous text, natural mobile wrapping. */
.relevant-provisions { font-size:.85rem; line-height:1.45; margin:.35rem 0 .65rem; color:var(--ink); overflow-wrap:anywhere; }
.relevant-provisions[hidden] { display:none; }

/* Brief reading surface and matched header. */
.case-brief-dialog { padding:0; border:1px solid #dbe6e0; border-radius:20px; background:#fffefa; box-shadow:0 24px 80px #142b2440; }
.case-brief-dialog .auth-form { display:block; padding:0 1.75rem 1.5rem; }
.case-brief-dialog .brief-header { margin:0 -1.75rem 1.5rem; padding:1.35rem 1.75rem 1.2rem; background:linear-gradient(140deg,#e8f2ed,#f4f7f0); border-bottom:1px solid #d8e4dc; box-shadow:0 5px 16px #244f3d0c; }
.case-brief-dialog .dialog-heading { align-items:flex-start; gap:1rem; }
.case-brief-dialog #ai-access-title { margin:0; color:#174c3c; font-size:1.2rem; }
.case-brief-dialog .ai-access-context { margin:.75rem 0 0; font-size:.95rem; line-height:1.55; font-weight:550; color:#344b40; text-align:start; }
.case-brief-content p { text-align:justify; text-align-last:start; white-space:normal; hyphens:auto; }
.case-brief-content h3 { text-align:start; margin:1.4rem 0 .5rem; }
.case-brief-content h3:first-child { margin-top:0; }
.case-brief-content [hidden] { display:none; }
.brief-revealing::after { content:""; display:inline-block; width:5px; height:1em; margin-left:3px; background:#32755e; vertical-align:text-bottom; animation:brief-caret .85s ease-in-out infinite; }
.brief-disclosure { color:var(--ink-soft); font-size:.75rem; line-height:1.5; border-top:1px solid #e1e8e2; padding-top:.9rem; margin:1.2rem 0; }
.auth-dialog:not(.case-brief-dialog) .brief-disclosure { display:none; }
@keyframes brief-caret {50%{opacity:.25}}
/* Search activity uses an indeterminate sweep, never invented percentages. */
.search-wait { padding:2rem 1.25rem; border:1px solid #e0e9e3; border-radius:16px; background:linear-gradient(140deg,#f5f9f6,#fff); text-align:center; }
.search-wait-graphic { display:flex; justify-content:center; gap:8px; height:28px; align-items:center; }
.search-orbit { display:block; width:10px; height:10px; border:2px solid #36735b; border-radius:50%; animation:search-orbit 1.5s ease-in-out infinite; }
.search-orbit:nth-child(2) { animation-delay:.18s; }.search-orbit:nth-child(3) { animation-delay:.36s; }
.search-wait-title { font-weight:650; color:#214f3c; margin:.65rem 0 .3rem; }
.search-wait-note { font-size:.85rem; color:var(--ink-soft); margin:0; }
.search-wait-track { max-width:220px; height:3px; background:#dce9e0; border-radius:6px; overflow:hidden; margin:1.1rem auto 0; }
.search-wait-track span { display:block; height:100%; width:40%; border-radius:inherit; background:#43856a; animation:search-sweep 1.6s ease-in-out infinite; }
#search-button[aria-busy="true"]::after { content:""; display:inline-block; margin-left:.5rem; width:.8em; height:.8em; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; vertical-align:-.1em; animation:search-spin .8s linear infinite; }
@keyframes search-orbit {50%{transform:translateY(-5px); background:#91baa4}}
@keyframes search-sweep {from{transform:translateX(-110%)}to{transform:translateX(360%)}}
@keyframes search-spin {to{transform:rotate(360deg)}}
@media(max-width:600px) {
 .case-brief-dialog .auth-form { padding:0 1.1rem 1.15rem; }
 .case-brief-dialog .brief-header { margin:0 -1.1rem 1.25rem; padding:1.1rem; }
 .case-brief-content { font-size:1rem; line-height:1.7; }
}
@media(prefers-reduced-motion:reduce) {
 .brief-revealing::after,.search-orbit,.search-wait-track span,#search-button[aria-busy="true"]::after { animation:none; }
 .search-wait-track span { width:100%; opacity:.5; }
}
