:root {
    --ink: #18211f;
    --muted: #68736e;
    --paper: #fffaf0;
    --panel: #ffffff;
    --line: #d9ded4;
    --accent: #176b56;
    --accent-dark: #0f493b;
    --danger: #9d2f2f;
    --ok: #1f7a4c;
    --shadow: 0 18px 50px rgba(24, 33, 31, .12);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Georgia, 'Times New Roman', serif; color: var(--ink); background: radial-gradient(circle at top left, #e8f3df, transparent 34rem), linear-gradient(135deg, #fffaf0, #eef4f1); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; font-weight: 700; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 4vw; background: rgba(255,255,255,.76); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.brand { font-size: 1.25rem; color: var(--ink); }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.container, .sign-shell { width: min(1120px, calc(100% - 2rem)); margin: 2rem auto; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.card { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(1rem, 3vw, 2rem); margin-bottom: 1.25rem; }
.hero-card { background: linear-gradient(135deg, #ffffff, #f2f8ee); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-size: .78rem; font-weight: 700; margin: 0 0 .4rem; }
h1, h2 { margin-top: 0; line-height: 1.1; }
label { display: grid; gap: .35rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; font: inherit; background: #fffdf8; }
button, .button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: .82rem 1.1rem; background: var(--accent); color: white; font: inherit; font-weight: 700; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); color: white; }
.secondary { background: #e8eee8; color: var(--ink); }
.secondary:hover { background: #dce5dc; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.full { grid-column: 1 / -1; }
.checkline { display: flex; align-items: flex-start; gap: .7rem; font-weight: 400; }
.checkline input { width: auto; margin-top: .2rem; }
.button-row, .section-head { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.data-table { width: 100%; border-collapse: collapse; overflow: hidden; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: .75rem; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: .85rem; }
.meta-grid { display: grid; grid-template-columns: 210px 1fr; gap: .55rem 1rem; }
.meta-grid dt { color: var(--muted); font-weight: 700; }
.hash { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; font-size: .9rem; }
.status { border-radius: 999px; padding: .18rem .58rem; background: #edf0ed; font-weight: 700; }
.status-open { color: #835a00; background: #fff2c7; }
.status-signed { color: var(--ok); background: #dff4e8; }
.status-expired, .status-archived { color: var(--muted); }
.alert, .error-card { border-left: 5px solid var(--danger); background: #fff1f1; }
.success { border-left: 5px solid var(--ok); background: #eefaf3; padding: 1rem; border-radius: 16px; margin: 1rem 0; }
.hint { color: var(--muted); margin-top: -.25rem; }
.pdf-frame { width: 100%; height: 82vh; min-height: 760px; border: 1px solid var(--line); border-radius: 18px; background: white; overflow: auto; }
.notice { background: #f6f1df; border: 1px solid #eadfb8; border-radius: 16px; padding: 1rem; }
.signature-canvas { width: 100%; height: 220px; border: 2px dashed #aab7ae; border-radius: 18px; background: white; touch-action: none; display: block; }
.login-card { width: min(430px, 100%); }
@media (max-width: 720px) { .form-grid, .meta-grid { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } .data-table { display: block; overflow-x: auto; } .pdf-frame { height: 78vh; min-height: 560px; } }
