:root {
  --line: #d4d4d8;
  --muted: #52525b;
  --bg-soft: #f4f4f5;
}

* { box-sizing: border-box; }

body {
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  color: #18181b;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1rem; margin: 2rem 0 0.75rem; }
section > h2:first-child { margin-top: 0; }

section { margin-bottom: 2rem; }

label { display: block; margin-bottom: 0.75rem; }
label > span { display: block; font-size: 0.875rem; color: var(--muted); }

input[type="text"], input[readonly] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

button {
  font: inherit;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--bg-soft); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: #18181b; color: #fff; border-color: #18181b; }
button.primary:hover:not(:disabled) { background: #3f3f46; }

table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--line); }
th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
td.actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  border: 1px solid;
}
.badge.requested { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.badge.approved  { color: #1e40af; border-color: #93c5fd; background: #eff6ff; }
.badge.signed    { color: #166534; border-color: #86efac; background: #f0fdf4; }
.badge.denied    { color: #991b1b; border-color: #fca5a5; background: #fef2f2; }
.badge.failed    { color: #991b1b; border-color: #fca5a5; background: #fef2f2; }

.hint, .muted { font-size: 0.875rem; color: var(--muted); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875em; }

#error {
  border-left: 3px solid #dc2626;
  background: #fef2f2;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}

#share {
  border-left: 3px solid #16a34a;
  background: #f0fdf4;
  padding: 0.75rem 1rem;
}
#share .row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

ol.timeline { list-style: none; padding: 0; margin: 0; }
ol.timeline li { border-bottom: 1px solid var(--line); padding: 0.5rem 0; font-size: 0.9375rem; }
ol.timeline .when { color: var(--muted); font-size: 0.8125rem; }

dl.detail { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.detail dt { color: var(--muted); font-size: 0.875rem; }
dl.detail dd { margin: 0; }

@media (prefers-color-scheme: dark) {
  :root { --line: #3f3f46; --muted: #a1a1aa; --bg-soft: #27272a; }
  body { background: #18181b; color: #f4f4f5; }
  input[type="text"], input[readonly] { background: #27272a; color: inherit; }
  button { background: #27272a; color: inherit; }
  button.primary { background: #f4f4f5; color: #18181b; border-color: #f4f4f5; }
  #error { background: #2a1416; }
  #share { background: #0f2417; }
}
