:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #607079;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --line: #dcd7cc;
  --navy: #103a4a;
  --navy-deep: #092b38;
  --gold: #b98637;
  --gold-soft: #f1e3c5;
  --green: #286b50;
  --red: #a33a32;
  --shadow: 0 20px 50px rgb(23 32 38 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
a { color: var(--navy); text-underline-offset: 3px; }
.topbar { height: 78px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--navy-deep); color: white; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 35%); border-radius: 11px; color: var(--gold-soft); font-family: Georgia, serif; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #bdd0d6; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.status { padding: 8px 12px; border: 1px solid transparent; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status-loading { color: #cfdae0; background: rgb(255 255 255 / 8%); }
.status-ok { color: #d8f5e8; border-color: rgb(133 221 183 / 35%); background: rgb(49 126 92 / 35%); }
.status-warning, .status-error { color: #ffe4d4; border-color: rgb(255 184 144 / 35%); background: rgb(142 65 45 / 35%); }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 330px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 50px; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h1 { max-width: 820px; margin-bottom: 18px; font-size: clamp(2.5rem, 5.8vw, 5rem); line-height: .99; letter-spacing: -.04em; }
.hero-copy { max-width: 700px; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.hero-badge { width: 150px; height: 150px; display: grid; place-content: center; text-align: center; border: 1px solid #d5c9b3; border-radius: 50%; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.hero-badge span { display: block; color: var(--navy); font-family: Georgia, serif; font-size: 3.4rem; line-height: 1; }
.search-panel { padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading, .results-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
h2 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.text-button, .version-button { padding: 0; border: 0; color: var(--navy); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 32px; }
.field { display: grid; gap: 9px; }
.field > span { font-size: .82rem; font-weight: 800; letter-spacing: .02em; }
.field small { color: var(--muted); font-size: .74rem; }
input, select { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgb(185 134 55 / 13%); }
#process-number { font-size: 1.16rem; letter-spacing: .04em; }
.advanced-fields { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 20px; margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 30px; }
.form-actions p { max-width: 520px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.primary-button, .secondary-button { min-height: 50px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.primary-button { min-width: 230px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 0 18px; border: 0; color: white; background: var(--navy); }
.primary-button:hover { background: var(--navy-deep); }
button:disabled { opacity: .55; cursor: wait; }
.feedback { margin: 24px 0; padding: 16px 18px; border-radius: 10px; line-height: 1.5; }
.feedback-info, .feedback-empty { border: 1px solid #c8d8df; color: var(--navy); background: #eef4f5; }
.feedback-error { border: 1px solid #e1bbb6; color: var(--red); background: #fff2f0; }
.results { padding: 62px 0 20px; }
.results-heading { margin-bottom: 22px; }
.results-heading > p { color: var(--muted); }
.partial-warning { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e8cf9b; border-radius: 9px; color: #6e4a12; background: #fff7e7; }
.results-list { display: grid; gap: 18px; }
.result-card { padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.result-card-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.result-card h3 { margin: 10px 0 0; font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: -.02em; }
.court-pill, .privacy-pill, .chip, .current-pill { display: inline-flex; align-items: center; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.court-pill { padding: 5px 9px; color: white; background: var(--navy); letter-spacing: .08em; }
.privacy-pill { padding: 6px 10px; color: var(--green); background: #e5f2eb; }
.cover-data { margin-top: 28px; }
.cover-heading { margin: 0; color: var(--navy); font-family: Inter, sans-serif; font-size: 1rem; font-weight: 800; }
.cover-copy { margin: 5px 0 0; color: var(--muted); font-size: .76rem; }
.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 18px; padding: 22px 0; border-block: 1px solid var(--line); }
.fact-wide { grid-column: span 2; }
.fact span, .subjects > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fact strong { display: block; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.45; }
.fact-mono strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.subjects { margin-top: 20px; }
.empty-field { font-size: .9rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 6px 10px; border: 1px solid #dac9a7; color: #72511e; background: #faf3e4; }
.additional-cover { margin-top: 26px; }
.additional-cover h5 { margin: 0; color: var(--navy); font-size: .82rem; }
.additional-facts { margin-top: 12px; padding-bottom: 0; border-bottom: 0; }
.movements { margin-top: 22px; }
.movements summary { color: var(--navy); font-weight: 800; cursor: pointer; }
.movements ol { display: grid; gap: 12px; margin: 18px 0 0; padding-left: 22px; }
.movements li { padding-left: 6px; }
.movements time { display: block; margin-bottom: 3px; color: var(--muted); font-size: .72rem; }
.secondary-button { display: block; margin: 24px auto 0; padding: 0 22px; border: 1px solid var(--navy); color: var(--navy); background: transparent; }
footer { width: min(1180px, calc(100% - 40px)); display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 60px auto 0; padding: 28px 0 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; }
footer p { max-width: 760px; line-height: 1.5; }
dialog { width: min(600px, calc(100% - 32px)); padding: 32px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(9 43 56 / 58%); backdrop-filter: blur(3px); }
.dialog-close { float: right; border: 0; color: var(--muted); background: transparent; font-size: 2rem; cursor: pointer; }
.build-metadata { color: var(--muted); font-size: .78rem; }
.build-metadata span { color: #8a969c; }
.version-entry { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.version-entry h3 { margin-bottom: 6px; }
.version-entry p { color: var(--muted); font-size: .78rem; }
.version-entry li { margin: 7px 0; line-height: 1.45; }
.current-pill { margin-left: 10px; padding: 4px 8px; color: var(--green); background: #e5f2eb; font-family: Inter, sans-serif; vertical-align: middle; }

@media (max-width: 760px) {
  .topbar { height: 70px; padding-inline: 18px; }
  .brand small { display: none; }
  .status { max-width: 140px; text-align: center; }
  main { width: min(100% - 28px, 1180px); }
  .hero { min-height: 380px; grid-template-columns: 1fr; padding: 54px 0; }
  .hero-badge { display: none; }
  h1 { font-size: 2.8rem; }
  .search-panel { padding: 22px; border-radius: 16px; }
  .section-heading { align-items: end; }
  .form-grid, .advanced-fields, .facts-grid { grid-template-columns: 1fr; }
  .fact-wide { grid-column: auto; }
  .form-actions, footer { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .result-card-header { align-items: start; flex-direction: column; }
  footer { gap: 12px; }
}
