:root {
  --bg: #f6f6f4; --fg: #111; --muted: #666; --card: #fff; --line: #e2e2de;
  --accent: #111; --accent-fg: #fff; --red: #b42318; --red-bg: #fef3f2; --green: #067647; --green-bg: #ecfdf3;
  --blue-bg: #eff4ff; --amber-bg: #fffaeb; --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f10; --fg: #f2f2f2; --muted: #9a9a9a; --card: #18181a; --line: #2c2c2f;
    --accent: #f2f2f2; --accent-fg: #111; --red-bg: #2a1513; --green-bg: #0f2419; --blue-bg: #141c2e; --amber-bg: #2a2310; color-scheme: dark; }
  .brand img { filter: invert(1); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: .02em; }
.brand img { height: 18px; }
.who { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { flex: 1; width: 100%; margin: 0 auto; padding: 40px 16px; }
main.narrow { max-width: 440px; }
main.wide { max-width: 860px; }
footer { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 20px 0; }
.card.warn { border-color: #f5c56b; background: var(--amber-bg); }
.stack { display: flex; flex-direction: column; gap: 14px; }
label, .label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
label.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
input, textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; }
input:disabled { color: var(--muted); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .button { font: inherit; font-size: 15px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.link { background: none; border: none; padding: 0; text-decoration: underline; color: inherit; font-size: inherit; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.alert.error { background: var(--red-bg); color: var(--red); }
.alert.info { background: var(--blue-bg); }
.pdf { margin: 20px 0; }
.pdf iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pad { position: relative; }
.pad canvas { width: 100%; height: 160px; border: 1px dashed var(--muted); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.pad canvas.signed { border-style: solid; }
.pad button { position: absolute; right: 10px; top: 8px; color: #555; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.revoked td { opacity: .55; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.tag.green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.tag.red { background: var(--red-bg); color: var(--red); border-color: transparent; }
@media (max-width: 600px) { .top { padding: 12px 16px; } main { padding: 24px 16px; } .card { padding: 18px; } }
