:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e9edf3;
  --text: #191c20;
  --muted: #5a6170;
  --line: #dfe3ea;
  --accent: #2f5fd0;
  --accent-text: #ffffff;
  --accent-soft: #e3ebfb;
  --danger: #b3261e;
  --danger-text: #ffffff;
  --success: #146c2e;
  --warning-bg: #fff4d6;
  --shadow: 0 1px 2px rgb(20 30 50 / 0.06), 0 2px 8px rgb(20 30 50 / 0.04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1b1e25;
    --surface-2: #252932;
    --text: #e4e6eb;
    --muted: #9aa1ae;
    --line: #2f343f;
    --accent: #a8c1ff;
    --accent-text: #0d2a66;
    --accent-soft: #25324f;
    --danger: #ffb4ab;
    --danger-text: #601410;
    --success: #7bdb97;
    --warning-bg: #3a3012;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* App bar */
header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .mark-bg { fill: var(--accent); }
.brand .mark-fg { fill: var(--accent-text); }
nav { display: flex; gap: 4px; }
nav button {
  border: 0; background: none; color: var(--muted); padding: 8px 16px; border-radius: 999px;
  font: inherit; font-weight: 500; cursor: pointer;
}
nav button:hover { background: var(--surface-2); color: var(--text); }
nav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main { max-width: 880px; margin: 0 auto; padding: 32px 24px 80px; }
h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 20px; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }

button, a.button {
  font: inherit; font-weight: 500; padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}
a.button { display: inline-block; text-decoration: none; }
button:hover { background: var(--surface-2); }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-text); font-weight: 600; }
button.primary:hover, button.danger:hover { filter: brightness(1.08); }
button.quiet { border-color: transparent; background: none; color: var(--muted); padding: 6px 12px; }
button.quiet:hover { color: var(--text); background: var(--surface-2); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, pre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

label { display: block; font-weight: 600; font-size: 0.875rem; margin: 18px 0 6px; }
input:not([type="file"]), textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}

.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 56px 20px; text-align: center; background: var(--surface); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.drop button { margin-top: 8px; }
.file-line { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
progress { width: 100%; height: 8px; accent-color: var(--accent); }

.muted { color: var(--muted); }
.error { color: var(--danger); }
.success { color: var(--success); font-weight: 600; }
.warning { background: var(--warning-bg); padding: 12px 14px; border-radius: 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.section-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; }
.section-head button { flex: none; }

.rows { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.rows:empty { display: none; }
.rows li { display: flex; gap: 8px; align-items: center; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .main { flex: 1; min-width: 0; }
.rows .name { font-weight: 600; overflow-wrap: anywhere; }
.rows .meta { color: var(--muted); font-size: 0.85rem; }
.rows .revoked .name { color: var(--muted); text-decoration: line-through; }

pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 0.82rem; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { border: 0; border-radius: 20px; background: var(--surface); color: var(--text); max-width: 460px; width: calc(100% - 32px); padding: 24px; box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); }
dialog h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
dialog .actions { justify-content: flex-end; }
dialog::backdrop { background: rgb(10 14 22 / 0.5); }
a { color: var(--accent); }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  header { padding: 10px 16px; gap: 8px; }
  main { padding: 24px 16px 64px; }
  .section-head { flex-direction: column; }
  .rows li { flex-wrap: wrap; }
}
