:root {
    color-scheme: light;
    --ink:#27261f; --muted:#69665d; --line:#e5dfd2; --gold:#cbaa67;
    --link:#765218; --paper:#fffdf8; --background:#f5f2eb; --dark:#24241f;
    font-family: system-ui, sans-serif;
}
* { box-sizing:border-box }
body { margin:0; background:var(--background); color:var(--ink); font-size:15px; line-height:1.5 }
a { color:var(--link); font-weight:650; text-underline-offset:3px }
a:hover { color:#402909 }
:focus-visible { outline:3px solid #9c6912; outline-offset:3px }
.top { background:var(--dark); color:#fffdf7; border-bottom:3px solid var(--gold) }
.top-inner { margin:auto; max-width:1248px; min-height:76px; padding:12px 24px; display:flex; gap:32px; align-items:center; flex-wrap:wrap }
.brand { display:inline-flex; align-items:center; text-decoration:none }
.brand-logo { display:block; width:clamp(135px, 28vw, 168px); height:auto }
.top nav { display:flex; gap:5px; flex-wrap:wrap }
.top nav a { color:#dedbd1; text-decoration:none; padding:8px 11px; border-radius:6px; white-space:nowrap }
.top nav a:hover,.top nav [aria-current] { background:#444039; color:#fff6df }
.account { margin-left:auto; display:flex; gap:12px; align-items:center; color:#e6decc; font-size:13px }
.account button { border-color:#8f8269; color:#fff6df }
.shell { max-width:1248px; padding:32px 24px 60px; margin:auto }
.heading { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:24px }
h1,h2,p { margin:0 }
h1,h2 { font-family:Georgia,serif; font-weight:600; letter-spacing:-.025em; line-height:1.1 }
h1 { font-size:clamp(32px,6vw,49px); overflow-wrap:anywhere }
h2 { font-size:24px; margin-bottom:15px }
.heading p { margin-top:8px; color:var(--muted) }
.eyebrow { font-size:12px; letter-spacing:.12em; text-transform:uppercase; font-weight:750; color:var(--link); margin-bottom:6px }
.back { display:inline-block; margin-bottom:10px }
.heading .badge { margin-top:8px }
.panel { background:var(--paper); padding:22px; border:1px solid var(--line); border-radius:12px; min-width:0 }
.login { max-width:480px; margin:8vh auto 0; padding:32px }
.login p + a,.login p + form,.login h1 + p,.login p + p { margin-top:16px }
.narrow { max-width:775px }
.stack,.fields { display:grid; gap:15px; align-content:start }
.metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:15px; margin-bottom:18px }
.metric { text-decoration:none; display:grid; gap:8px; color:var(--ink) }
.metric:hover { border-color:#bda674 }
.metric span { color:var(--muted) }
.metric strong { font:600 36px Georgia,serif }
.record-grid { display:grid; gap:18px; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); align-items:start }
.section-title { display:flex; justify-content:space-between; gap:12px; align-items:start }
.button,button { font:650 14px system-ui; display:inline-flex; align-items:center; justify-content:center; padding:9px 13px; background:#e4c984; color:#272013; border:1px solid #c2a258; border-radius:7px; cursor:pointer; text-decoration:none; white-space:nowrap }
.button:hover,button:hover { background:#efd695; color:#272013 }
button.subtle { background:transparent; border-color:#d6c9ad; color:var(--link) }
button.subtle:hover { background:#eee4cc; color:var(--ink) }
input,select,textarea { border:1px solid #cfc7b7; border-radius:6px; padding:8px 10px; color:var(--ink); background:white; font:inherit; max-width:100%; min-width:0 }
textarea { resize:vertical }
label { display:grid; gap:6px; font-weight:650; min-width:0 }
.field-grid { display:grid; grid-template-columns:1fr 1fr; gap:15px }
.search { display:grid; gap:6px; margin-bottom:18px }
.search div,.inline,.task-state { display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.search input { width:min(100%,420px) }
.table-wrap { overflow-x:auto }
table { border-collapse:collapse; width:100%; text-align:left }
th,td { padding:11px 12px; border-bottom:1px solid var(--line); overflow-wrap:anywhere }
th { color:var(--muted); font-size:13px }
tr:last-child td { border:0 }
.badge { display:inline-block; padding:3px 8px; border-radius:6px; background:#f2ead6; color:#57451f; font-size:12px; overflow-wrap:anywhere }
.badge.overdue,.error { background:#f8e6df; color:#792f23 }
.notice { margin-bottom:14px; padding:12px; border-radius:7px; background:#f2e6cb }
.notice.error { background:#f8e6df }
.notice ul { margin:0; padding-left:22px }
.notice.success { background:#e5eedf; color:#2d5033 }
.filters,.pagination { display:flex; gap:10px; flex-wrap:wrap; align-items:center }
.filters { margin-bottom:15px }
.filters a { border:1px solid var(--line); padding:6px 10px; border-radius:6px; text-decoration:none; background:var(--paper) }
.filters [aria-current] { background:#f1dfab; border-color:#c6ac6e; color:var(--ink) }
.pagination { margin-top:14px; color:var(--muted) }
.list,.timeline { list-style:none; padding:0; margin:0 }
.list li,.timeline li { border-top:1px solid var(--line); padding:11px 0; overflow-wrap:anywhere }
.list li { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px }
.tasks li a { display:block }
.timeline { margin-top:18px }
.timeline small,.muted { color:var(--muted) }
.timeline p { white-space:pre-wrap }
dl { margin:0; display:grid; grid-template-columns:max-content minmax(0,1fr); gap:8px 12px }
dt { color:var(--muted) }
dd { margin:0; overflow-wrap:anywhere }
@media (max-width:720px) {
    .top-inner,.shell { padding-inline:16px }
    .top-inner { gap:10px }
    .top nav { order:3; width:100% }
    .top nav a { padding:6px; font-size:13px }
    .account span { display:none }
    .record-grid { grid-template-columns:1fr }
    .metrics { gap:8px }
    .metric { font-size:13px; padding:12px }
    .panel { padding:15px }
}
@media (max-width:380px) { .field-grid { grid-template-columns:1fr } }
