:root {
  --ink: #172c29; --ink-soft: #4d625c; --green: #16483d; --green-dark: #10392f;
  --paper: #f6f6f1; --card: #fffefa; --line: #d4dad0; --accent: #ba9263;
  --sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  font: 16px/1.5 var(--sans); color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid #478574; outline-offset: 3px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; z-index: 5; padding: 12px; background: white; }
.top { background: var(--green-dark); color: #fffdf6; border-bottom: 3px solid var(--accent); }
.top-inner, main { width: min(1500px, 94%); margin: auto; }
.top-inner, .brand, .account, .workspace-head, .list-head, .pages, .pages div, .detail-head, .detail-actions { display: flex; align-items: center; }
.top-inner { justify-content: space-between; min-height: 65px; }
.brand { gap: 13px; font: 23px/1 var(--serif); }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #c6ac82; color: #e4d0af; font: italic 25px/1 var(--serif); }
.account { gap: 16px; font-size: 14px; }
.account .btn-quiet { color: #f6f4e9; }
.account .btn-quiet:hover { color: white; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 39px; padding: 8px 15px; line-height: 1.3; font-size: 14px; font-weight: 600; border: 1px solid transparent; border-radius: 5px; }
.btn-primary { color: #fff; background: var(--green); }
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-normal { background: var(--card); color: var(--ink); border-color: #c6cec3; }
.btn-normal:hover:not(:disabled) { background: #eaf0e7; }
.btn-quiet { background: transparent; color: var(--green); }
.btn-quiet:hover:not(:disabled) { text-decoration: underline; }
.boot { margin: 50px 0; }
.login { display: grid; align-items: stretch; grid-template-columns: 1fr 1fr; max-width: 860px; margin: clamp(44px, 12vh, 145px) auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.login-intro { display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; background: var(--green-dark); color: #fffdf6; border-right: 3px solid var(--accent); }
.login-intro .eyebrow { color: #e3d1b5; }
.login h1 { font: 52px/1.1 var(--serif); letter-spacing: -.035em; }
.login-form { padding: 46px 36px; display: grid; gap: 18px; }
.login-form h2, .detail-head h2 { font: 32px/1.17 var(--serif); }
.login-form .btn { margin-top: 4px; justify-content: space-between; }
label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
input, select, textarea { border: 1px solid #bfc9c0; border-radius: 4px; padding: 8px 10px; color: var(--ink); background: white; width: 100%; font-size: 15px; font-weight: 400; }
input, select { min-height: 41px; }
textarea { display: block; resize: vertical; line-height: 1.5; }
.eyebrow { text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .13em; color: var(--ink-soft); margin-bottom: 6px; }
.workspace { padding: 38px 0 40px; }
.workspace-head { justify-content: space-between; align-items: end; padding-bottom: 23px; }
.workspace h1 { font: 46px/1.08 var(--serif); letter-spacing: -.035em; }
.tools { padding: 18px; background: #ecefe7; border: 1px solid var(--line); border-radius: 6px; display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.search-label { flex: 2 1 270px; }
.search-box { position: relative; }
.search-box i { position: absolute; width: 13px; height: 13px; border: 1.6px solid var(--ink-soft); border-radius: 50%; left: 14px; top: 12px; }
.search-box i::after { content: ""; background: var(--ink-soft); position: absolute; width: 7px; height: 1.6px; left: 9px; top: 10px; transform: rotate(45deg); }
.search-box input { padding-left: 40px; }
.filters { display: flex; flex: 3 1 560px; gap: 12px; }
.filters label { min-width: 0; flex: 1; }
.filters select { text-overflow: ellipsis; }
.clear { min-height: 41px; }
.list-head { margin: 23px 0 10px; justify-content: space-between; }
.list-head p, .pages { font-size: 14px; color: var(--ink-soft); }
.list-head p { font-weight: 600; }
.page-size { display: flex; align-items: center; gap: 10px; }
.page-size select { width: auto; min-height: 33px; padding: 3px 6px; font-size: 14px; }
.list-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; line-height: 1.4; }
th { padding: 12px 14px; color: var(--ink-soft); background: #eaeee6; white-space: nowrap; font-size: 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 14px; border-bottom: 1px solid #e2e6de; vertical-align: top; max-width: 340px; overflow-wrap: anywhere; }
tbody tr:last-child td { border: 0; }
tbody tr:hover, tbody tr:focus-within { background: #f0f4eb; }
.cell-summary { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-open { font: 600 15px/1.4 var(--sans); color: var(--green); background: transparent; border: 0; padding: 0; text-align: left; text-decoration: underline; text-decoration-color: #9ab1a1; text-underline-offset: 3px; white-space: nowrap; }
.court-name { margin-top: 3px; font-size: 13px; color: var(--ink-soft); max-width: 310px; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-soft); }
.pages { justify-content: space-between; margin-top: 16px; }
.pages div { gap: 8px; }
.error { padding: 10px 14px; border: 1px solid #d5a798; border-radius: 4px; color: #862e20; background: #fff1eb; font-size: 14px; }
.list-head + .error, .detail-body .error { margin-bottom: 10px; }
dialog { padding: 0; width: min(900px, 95vw); max-height: 92vh; max-height: 92dvh; border: 1px solid #a0ada0; border-radius: 8px; background: var(--card); color: var(--ink); box-shadow: 0 25px 70px #14241d35; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #14271ed0; }
.detail-head, .detail-actions { flex: none; justify-content: space-between; gap: 16px; padding: 18px 26px; background: #f2f4ec; }
.detail-head { border-bottom: 1px solid var(--line); }
.subtitle { font-size: 14px; margin-top: 3px; color: var(--ink-soft); }
.detail-body { overflow: auto; padding: 18px 26px 25px; }
.detail-body h3 { font: 23px/1.3 var(--serif); margin: 10px 0 16px; }
.detail-body section, .updates { margin: 0 0 18px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0 0 30px; }
.field-wide { grid-column: 1/-1; }
.fields label { align-content: start; }
.fields textarea { min-height: 70px; }
.original, .update { padding: 11px 0; border-bottom: 1px solid var(--line); }
.original dt, .update-meta { color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.original dd, .update p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-label { margin-bottom: 5px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.detail-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); color: white; background: var(--green-dark); border-radius: 5px; padding: 10px 18px; box-shadow: 0 6px 22px #182b2030; }
@media (max-width: 800px) {
  .filters { flex-basis: 100%; flex-wrap: wrap; }
  .filters label { flex: 1 1 38%; }
  .list-wrap table { min-width: 720px; }
  .login-intro { padding: 30px; }
}
@media (max-width: 580px) {
  .top-inner, main { width: 92%; }
  .brand { font-size: 19px; gap: 8px; }
  .account { gap: 2px; }
  .account #username { display: none; }
  .workspace { padding-top: 24px; }
  .workspace h1 { font-size: 38px; }
  .login { margin: 35px auto; display: block; }
  .login-intro { border: 0; border-bottom: 3px solid var(--accent); }
  .login-intro h1 { font-size: 37px; }
  .login-form { padding: 25px; }
  .tools { gap: 10px; padding: 12px; }
  .detail-head, .detail-body, .detail-actions { padding: 14px; }
  .detail-head h2 { font-size: 27px; }
  .fields { grid-template-columns: 1fr; }
  .pages .btn { padding: 7px 9px; }
}

.panel-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 5px; background: #fff; }
#install-panel { margin-inline-start: auto; margin-inline-end: 12px; }
