:root {
  color-scheme: light;
  --dark: #203126;
  --green: #34503a;
  --line: #9aa99a;
  --gold: #cfb476;
  --ink: #17231b;
  --paper: #ffffff;
  --ground: #f3f5f0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

:root[data-large-text="true"] { font-size: 20px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); line-height: 1.55; }
button, input { font: inherit; }
a { color: #173d26; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #705113; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; z-index: 5; background: white; padding: 0.6rem; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.topbar { background: var(--dark); color: white; }
.topbar-inner { max-width: 1120px; margin: auto; padding: 0.9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.85rem; color: white; text-decoration: none; font-size: 1rem; font-weight: 750; line-height: 1.25; }
.brand img { width: 3.2rem; height: 3.2rem; border-radius: 0.45rem; object-fit: contain; border: 1px solid var(--gold); }
.topbar-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.topbar-actions a { color: white; font-weight: 700; }
.text-button { border: 1px solid white; color: white; background: transparent; border-radius: 0.35rem; padding: 0.4rem 0.65rem; cursor: pointer; }
.text-button:hover { background: white; color: var(--dark); }

main { width: min(100% - 2rem, 1000px); margin: 2.7rem auto 4rem; }
.intro { max-width: 790px; margin-bottom: 1.6rem; }
.eyebrow { font-size: 0.9rem; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
h1 { margin: 0.5rem 0 0.7rem; line-height: 1.18; font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { line-height: 1.2; font-size: 1.4rem; margin: 0 0 0.65rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.2rem; }
p { margin-top: 0; }
.intro p { font-size: 1.08rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 0.75rem; padding: clamp(1.2rem, 3vw, 2rem); margin-bottom: 1.4rem; }
.login-panel { max-width: 570px; }
.form-grid { display: grid; gap: 1rem; }
label { display: block; font-weight: 700; margin-bottom: 0.25rem; }
input[type="text"], input[type="password"] { width: 100%; min-height: 2.9rem; background: white; color: var(--ink); padding: 0.6rem 0.8rem; border: 2px solid #758b79; border-radius: 0.35rem; }
input[type="file"] { display: block; width: 100%; max-width: 100%; padding: 0.7rem; border: 2px solid #758b79; border-radius: 0.35rem; background: white; }
.button { min-height: 2.9rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.55rem 0.95rem; border: 2px solid var(--dark); border-radius: 0.4rem; background: var(--dark); color: white; font-weight: 700; cursor: pointer; text-decoration: none; }
.button:hover { background: #0d1a12; }
.button:disabled { opacity: 0.6; cursor: wait; }
.button-outline { color: var(--dark); background: white; }
.button-outline:hover { color: white; background: var(--dark); }
.button-danger { color: #7b2020; background: white; border-color: #a84040; }
.button-danger:hover { color: white; background: #7b2020; }
.help { font-size: 0.95rem; color: #37463c; }
.status { display: block; min-height: 1.6rem; margin-top: 0.85rem; font-weight: 700; }
.status.error { color: #8c2020; }
.status.success { color: #205b2c; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 0.35rem; padding: 0.1rem 0.5rem; font-size: 0.9rem; font-weight: 700; }
.pill.off { border-color: #8d3636; color: #7b2020; }
.meta { font-size: 0.95rem; color: #37463c; }
.document-list, .case-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.document-list li, .case-list li { padding: 0.85rem 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.document-list a { font-weight: 700; overflow-wrap: anywhere; }
.document-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.case-list .button { flex-shrink: 0; }
.admin-layout { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1.2rem; align-items: start; }
.admin-layout > .panel { margin: 0; }
.actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 1rem; }
.credential-box { background: #fff8e6; border: 2px solid #967631; border-radius: 0.55rem; padding: 1.1rem; margin: 1rem 0; }
.credential-box code { display: block; font-size: 1rem; overflow-wrap: anywhere; user-select: all; margin: 0.25rem 0 0.65rem; }
.credential-box p { margin-bottom: 0.4rem; }
.site-footer { background: var(--dark); color: white; padding: 1.4rem; }
.site-footer p { max-width: 1000px; margin: auto; }
@media (max-width: 730px) { .admin-layout { grid-template-columns: 1fr; } .topbar-inner { align-items: start; } }
@media (max-width: 480px) { .brand { max-width: 60%; } .brand img { width: 2.7rem; height: 2.7rem; } .topbar-actions { justify-content: end; } }
@media (prefers-contrast: more) { :root { --line: #263d2b; --ground: white; } .panel { border-width: 2px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
