:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1b1f26;
  --muted: #646d7a;
  --accent: #2f6df6;
  --accent-soft: #eaf1ff;
  --ok: #1f8a4c;
  --warn: #b45309;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.wrap { max-width: 780px; margin: 0 auto; padding: 32px 20px 64px; }
.wrap.wide { max-width: 1100px; }
header.bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
header.bar .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
header.bar a { color: var(--muted); text-decoration: none; font-size: 14px; }
header.bar a:hover { color: var(--accent); }
header.bar .grow { flex: 1; }
h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 32px 0 12px; }
.lead { color: var(--muted); margin: 0 0 28px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.progress { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.bar-track { height: 5px; background: var(--border); border-radius: 3px; margin-bottom: 26px; }
.bar-fill { height: 5px; background: var(--accent); border-radius: 3px; }
.qkey {
  display: inline-block; font: 12px/1 ui-monospace, monospace;
  background: var(--accent-soft); color: var(--accent);
  padding: 5px 8px; border-radius: 5px; margin-bottom: 12px;
}
.qbody { margin-bottom: 20px; }
.qbody p:first-child { margin-top: 0; }
textarea, input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 10px 12px; font: inherit;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; text-decoration: none; display: inline-block;
}
button.ghost, .btn.ghost { background: #fff; color: var(--muted); border-color: var(--border); }
button.ghost:hover { color: var(--accent); border-color: var(--accent); }
button.small { padding: 6px 12px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.pill.open { background: #fff4e5; color: var(--warn); }
.pill.done { background: #e7f6ed; color: var(--ok); }
.pill.grey { background: var(--border); color: var(--muted); }
.thread { border-left: 3px solid var(--border); padding-left: 14px; margin: 16px 0; }
.msg { margin-bottom: 14px; font-size: 15px; }
.msg .who { font-size: 12px; color: var(--muted); font-weight: 600; }
.msg .text { white-space: pre-wrap; }
.msg.analyst .who { color: var(--accent); }
pre.mail {
  white-space: pre-wrap; font: 14px/1.6 ui-monospace, monospace;
  background: #fbfbfc; border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; margin: 0;
}
.muted { color: var(--muted); font-size: 14px; }
.err { background: #fdecec; border: 1px solid #f5c2c2; color: #a11; padding: 12px 14px;
       border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.issue-list { max-height: 520px; overflow-y: auto; border: 1px solid var(--border);
              border-radius: 8px; }
.issue-list table { font-size: 14px; }
.issue-list select { width: auto; min-width: 160px; padding: 5px 8px; font-size: 14px; }
textarea.mail {
  white-space: pre-wrap; font: 14px/1.6 ui-monospace, monospace;
  background: #fbfbfc; min-height: 420px;
}

/* Wybór osoby: klikalne pastylki zamiast listy radio */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
button.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 20px; cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
button.choice:hover {
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-1px);
}
button.choice .choice-name { font-weight: 600; font-size: 15px; }
button.choice .choice-meta { font-weight: 400; font-size: 12px; color: var(--muted); }
button.choice:hover .choice-meta { color: var(--accent); }
button.choice.is-done { opacity: .6; }
