@font-face { font-family: Barlow; font-weight: 400; src: url(/fonts/barlow-400.woff) format("woff"); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 500; src: url(/fonts/barlow-500.woff) format("woff"); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 600; src: url(/fonts/barlow-600.woff) format("woff"); font-display: swap; }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; src: url(/fonts/barlow-condensed-500.woff) format("woff"); font-display: swap; }

:root { --ink: #111; --muted: #757575; --line: #e6e3e3; --line2: #d4d0d0; --bg: #fff; --bg2: #f6f5f4; --red: #c4161c; --ok: #2f6b4f; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 Barlow, system-ui, sans-serif; color: var(--ink); background: var(--bg2); }
a { color: inherit; }
h1, h2 { font-weight: 500; margin: 0 0 14px; letter-spacing: .01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; }
.muted { color: var(--muted); } .small, small { font-size: 12.5px; }
.num { font-family: "Barlow Condensed", Barlow, sans-serif; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand span { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; border-left: 1px solid var(--line2); padding-left: 14px; }
.top nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.top nav a, .top nav button { text-decoration: none; }
.top nav a:hover, .top nav button:hover { color: var(--red); }

main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } main { padding: 16px; } .top { padding: 10px 16px; } }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 22px; }
.login { max-width: 380px; margin: 60px auto; display: grid; gap: 14px; }
.narrow { max-width: 720px; margin: 0 auto; }

.form { display: grid; gap: 18px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
label { display: grid; gap: 4px; }
label > span { font-size: 13px; color: var(--muted); }
label small { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grow { flex: 1 1 180px; } .zip { flex: 0 0 110px; } .cty { flex: 0 0 150px; }
@media (max-width: 520px) { .zip { flex-basis: 90px; } .cty { flex: 1 1 100%; } }
input, select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; height: 40px; padding: 0 11px; width: 100%; }
textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; padding: 9px 11px; width: 100%; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
input.big { font-size: 22px; height: 48px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 4px; border: 1px solid var(--line2); background: var(--bg); font: 500 14px Barlow, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #a71217; }
.btn.ghost { border-color: transparent; }
.btn.wide { width: 100%; height: 46px; font-size: 15px; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; }

.err { background: #fbeaea; color: var(--red); border-radius: 4px; padding: 10px 12px; font-size: 14px; }
.warn { background: #fff6e0; border-radius: 4px; padding: 10px 12px; font-size: 14px; display: grid; gap: 8px; }
.okbox { background: #e8f2ec; color: var(--ok); border-radius: 4px; padding: 10px 12px; font-size: 14px; }
.ok { color: var(--ok); font-size: 13px; font-weight: 500; }

.result { display: grid; gap: 16px; }
.result-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.result-head h2 { margin: 4px 0 2px; } .result-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview { width: 100%; height: 78vh; min-height: 480px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg2); }

.hist-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.hist-head h2 { margin: 0; } .hist-head form { flex: 1 1 200px; max-width: 280px; }
.hist-head input { height: 36px; }
.hist ul { list-style: none; margin: 0 -22px; padding: 0; }
.hist li { border-top: 1px solid var(--line); padding: 10px 22px; display: grid; gap: 4px; }
.hist li:hover { background: var(--bg2); }
.hist .main { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; text-decoration: none; }
.hist .no { font-weight: 500; font-size: 14px; }
.hist .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .who small { display: block; color: var(--muted); }
.hist .amt { font-size: 17px; }
.hist .tools { display: flex; gap: 16px; font-size: 13px; padding-left: 122px; }
.hist .tools form { display: inline; }
@media (max-width: 520px) { .hist .main { grid-template-columns: 1fr auto; } .hist .no { grid-column: 1 / -1; } .hist .tools { padding-left: 0; } }
