:root {
  --bg: #f5f6f8;
  --fg: #1f2328;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --primary: #2b6cb0;
  --primary-hover: #1e4e80;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; color: inherit; text-decoration: none; }
.brand:hover { color: var(--primary); }

.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar .who { color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.topbar .who:hover { color: var(--primary); text-decoration: underline; }

.container {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.centered { text-align: center; }
.centered h1 { margin-top: 0; }

.muted { color: var(--muted); }

.btn-primary, .btn-link {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-link {
  color: var(--primary);
  background: transparent;
}
.btn-link:hover { text-decoration: underline; }

.kv {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 1.5rem;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.groups { list-style: disc; padding-left: 1.25rem; }
.groups li { margin: 0.15rem 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f3f5;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

.small { font-size: 0.85rem; }

.tools, .downloads { list-style: none; padding: 0; margin: 0 0 1rem; }
.tools > li, .downloads > li { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.tools > li:last-child, .downloads > li:last-child { border-bottom: none; }
.tool-link { font-weight: 600; text-decoration: none; color: var(--primary); }
.tool-link:hover { text-decoration: underline; }

.form { display: flex; flex-direction: column; gap: 0.4rem; }
.form label { font-weight: 500; margin-top: 0.6rem; }
.form input[type="text"] {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}
.form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
.form input[type="file"] { padding: 0.4rem 0; }
.form .actions { margin-top: 1.25rem; }

.alert {
  background: #fff4f4;
  border: 1px solid #f3c6c6;
  color: #842121;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin: 0.5rem 0 1.25rem;
}
.alert pre {
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  font-size: 0.85rem;
}

.status {
  background: #f1f6fb;
  border: 1px solid #cfdef0;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}

.preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.preview th, .preview td {
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.preview th { background: #f7f8fa; font-weight: 600; }
.preview td.num, .preview th.num { text-align: right; font-variant-numeric: tabular-nums; }
