:root { color-scheme: light; --green:#174735; --deep:#10382a; --ink:#182922; --muted:#52655c; --line:#dce6df; --light:#f3f7f4; font: 100%/1.5 system-ui, sans-serif; }
* { box-sizing:border-box; }
body { margin:0; background:white; color:var(--ink); }
a { color:var(--green); text-underline-offset:.2em; }
a:hover { color:var(--deep); }
:focus-visible { outline:3px solid #398369; outline-offset:3px; }
.top { border-bottom:1px solid var(--line); }
.top-inner { max-width:76rem; padding:1rem clamp(1rem,4vw,3rem); margin:auto; display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.brand { font-weight:780; text-decoration:none; font-size:1.125rem; }
.brand span { font-weight:550; }
nav { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem 1.15rem; font-size:.9375rem; }
nav a { text-decoration:none; }
nav a[aria-current] { font-weight:750; text-decoration:underline; }
nav form { margin:0; }
.workspace { max-width:76rem; margin:auto; padding:clamp(1.75rem,5vw,4rem) clamp(1rem,4vw,3rem); }
.workspace.compact { max-width:38rem; }
h1 { margin:0 0 1.25rem; font-size:clamp(1.75rem,4vw,2.5rem); line-height:1.15; letter-spacing:-.035em; }
h2 { margin:.7rem 0 0; font-size:1.125rem; }
.intro { color:var(--muted); margin:0 0 1.25rem; }
.panel { border:1px solid var(--line); border-radius:.65rem; background:white; }
.form { max-width:39rem; display:grid; gap:1rem; padding:clamp(1rem,4vw,1.6rem); }
label { display:grid; gap:.35rem; font-size:.9375rem; font-weight:650; }
input:not([type=checkbox]), select { min-width:0; width:100%; border:1px solid #aebfb4; border-radius:.4rem; padding:.6rem .7rem; font:inherit; font-size:1rem; color:var(--ink); background:white; }
input[type=checkbox] { accent-color:var(--green); width:1.05rem; height:1.05rem; margin:0; }
.choice { display:flex; align-items:center; gap:.55rem; min-height:2rem; font-weight:500; }
fieldset { margin:0; padding:.65rem .8rem; border:1px solid var(--line); border-radius:.4rem; min-width:0; }
legend { font-weight:650; padding:0 .25rem; }
button,.button { border:1px solid var(--green); border-radius:.4rem; background:var(--green); color:white; padding:.55rem .9rem; font:inherit; font-weight:650; cursor:pointer; text-decoration:none; display:inline-block; justify-self:start; }
button:hover,.button:hover { background:var(--deep); color:white; }
button.secondary { background:white; color:var(--green); padding:.35rem .65rem; }
button.secondary:hover { background:var(--light); }
.hint { color:var(--muted); font-size:.875rem; margin:0; }
.actions { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.split { display:grid; grid-template-columns:2fr 1fr; gap:.75rem; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap:.9rem; }
.card { padding:1rem; text-decoration:none; display:grid; align-content:start; gap:.3rem; }
.card:hover { background:var(--light); }
.card span { color:var(--muted); }
.table-wrap { overflow:auto; }
table { border-collapse:collapse; width:100%; text-align:left; font-size:.9375rem; }
th,td { padding:.72rem .85rem; vertical-align:top; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
th { background:var(--light); white-space:nowrap; }
tr:last-child td { border-bottom:0; }
td time { white-space:nowrap; }
.pagination { margin-top:1rem; }
.notice { border:1px solid var(--line); background:var(--light); padding:.65rem .85rem; border-radius:.4rem; }
.error { color:#842820; border-color:#edd6d3; background:#fff6f5; }
.sr-only,.skip:not(:focus) { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.skip:focus { display:inline-block; padding:.5rem; }
@media(max-width:42rem) { .top-inner { align-items:flex-start; flex-direction:column; } .table-wrap { max-width:100%; } }

input, select, textarea { font:inherit; }
textarea { width:100%; resize:vertical; border:1px solid #aebfb4; padding:.6rem .7rem; border-radius:.4rem; color:var(--ink); }
.filters { display:grid; align-items:end; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:.8rem; padding:1rem; margin-bottom:1rem; }
.toolbar { margin:0 0 1rem; }
.toolbar form { margin:0; }
.record-details { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap:1rem; padding:1.25rem; }
.record-details dt, .table-wrap summary { font-weight:650; }
.record-details dd { color:var(--muted); white-space:pre-wrap; margin:.2rem 0 0; overflow-wrap:anywhere; }
.record-section { margin:1.5rem 0; }
.record-section h2 { margin-bottom:.7rem; }
.audit-diff div { margin:.55rem 0; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:42rem) { .filters { grid-template-columns:1fr; } }
[hidden] { display:none !important; }
.document-form { max-width:65rem; }
.document-filters { grid-template-columns:repeat(auto-fit,minmax(min(100%,11rem),1fr)); }
.rich-editor { display:grid; gap:.45rem; }
.rich-editor > span { font-weight:650; }
.editable { padding:.75rem; min-height:10rem; border:1px solid #aebfb4; border-radius:.4rem; overflow-wrap:anywhere; }
[data-item-editor] input { min-width:6rem; }
[data-item-editor] td:nth-child(2) input { min-width:12rem; }
.document-paper { width:min(100%,210mm); min-height:min(297mm,calc((100vw - 2rem) * 1.415)); padding:clamp(1rem,4vw,16mm); border:1px solid var(--line); margin:1rem auto; overflow-wrap:anywhere; }
.letterhead { display:flex; flex-wrap:wrap; align-items:flex-start; gap:1rem; padding-bottom:1rem; border-bottom:2px solid var(--green); }
.letterhead img,.settings-logo { max-width:10rem; max-height:4.5rem; object-fit:contain; }
.letterhead strong { font-size:1.25rem; }
.paper-meta { margin-top:1.5rem; display:flex; flex-wrap:wrap; gap:.5rem 1rem; justify-content:space-between; align-items:baseline; }
.paper-meta h2 { margin:0; font-size:1.65rem; }
.letter-meta { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.25rem 1rem; }
.letter-meta dt { font-weight:650; }
.letter-meta dd { margin:0; }
.document-paper h4 { margin-bottom:.3rem; }
.document-paper footer { border-top:1px solid var(--line); margin-top:2rem; padding-top:.75rem; color:var(--muted); }
.lines { white-space:pre-wrap; }
.pdf-frame { width:100%; height:75vh; border:1px solid var(--line); margin-top:1rem; }
.paper-items { width:100%; margin-bottom:.75rem; }
.letterhead-table { width:100%; font-size:.875rem; }
.letterhead-table td { padding:0; }
.letterhead-table .logo-cell { width:10rem; padding-right:1rem; }
.letter-meta { display:table; width:auto; }
.letter-meta th,.letter-meta td { background:white; border:0; padding:.15rem 1rem .15rem 0; }
.signature { margin-top:1.6rem; }
.signature-rule { border-top:1px solid var(--muted); margin-top:2rem; padding-top:.35rem; width:min(100%,14rem); }
.archive-actions a { display:block; white-space:nowrap; }
.report-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,10.75rem),1fr)); gap:.8rem; margin:1rem 0; }
.report-metrics > div { padding:.85rem 1rem; }
.report-metrics dt { color:var(--muted); font-size:.9375rem; }
.report-metrics dd { margin:.25rem 0 0; font-size:1.65rem; color:var(--green); font-weight:730; }
.project-badge { display:inline-block; border-radius:.35rem; padding:.16rem .46rem; font-size:.85rem; font-weight:650; white-space:nowrap; }
.project-active { background:#e6f3e9; color:#175c31; }
.project-on_hold { background:#fff0dd; color:#89460a; }
.project-completed { background:#e7f0ff; color:#234e89; }
.project-cancelled { background:#fbe8e9; color:#8e2732; }
.project-date-warning { color:#89460a; font-size:.85rem; font-weight:650; }
.project-status-form:not(:has(option[value="completed"]:checked)) label:has(input[name="completion_date"]) { display:none; }
