:root {
  --paper: #fbfaf6;
  --paper-2: #f3f1ea;
  --card: #ffffff;
  --ink: #16202e;
  --ink-2: #3c4757;
  --ink-3: #6b7482;
  --line: #e4e0d5;
  --line-2: #d4cfc1;
  --accent: #1d6b57;
  --accent-2: #e5f1ec;
  --accent-ink: #0f4a3b;
  --amber: #a15c07;
  --amber-2: #fdf1dc;
  --red: #b3261e;
  --red-2: #fbe9e7;
  --blue: #1f4e8c;
  --blue-2: #e7eef8;
  --mark: #fff0b3;
  --mark-strong: #ffd95a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 46, .06), 0 4px 16px rgba(22, 32, 46, .05);
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.55 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .88em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  padding: .52em 1em; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 14px;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--paper-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--red); border-color: #e7b9b5; }
.btn.danger:hover { background: var(--red-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.small { padding: .3em .7em; font-size: 13px; }
.btn.big { padding: .75em 1.4em; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: 8px;
  padding: .55em .75em; font-size: 14px;
}
textarea { resize: vertical; min-height: 160px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 .35em; }
.field { margin-bottom: 1em; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: .3em; }

.pill {
  display: inline-flex; align-items: center; gap: .3em; padding: .12em .6em; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
}
.pill.high, .pill.red { background: var(--red-2); color: var(--red); }
.pill.medium, .pill.amber { background: var(--amber-2); color: var(--amber); }
.pill.low, .pill.green { background: var(--accent-2); color: var(--accent-ink); }
.pill.blue { background: var(--blue-2); color: var(--blue); }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: .75em; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-20px);
  background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 8px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }
