:root {
  color-scheme: light;
  --bg: #fbfdff;
  --card: #ffffff;
  --ink: #2b3a4a;
  --muted: #5f7080;
  --line: #e2e9f0;
  --accent: #1b88bd;
  --accent-ink: #ffffff;
  --ok-bg: #e8f7ee;  --ok-ink: #22653d;
  --warn-bg: #fff7e0; --warn-ink: #7a5a00;
  --err-bg: #fdecea; --err-ink: #9b2c1f;
}
* { box-sizing: border-box; }
html { font-size: 19px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.55;
}
a { color: var(--accent); }
header.site {
  background: #eef7fd; border-bottom: 1px solid var(--line);
}
header.site .inner {
  max-width: 760px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
header.site .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
header.site .brand img { height: 36px; width: auto; }
header.site nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
header.site nav a { text-decoration: none; font-weight: 600; }
header.site nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
main.wide { max-width: 1100px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
p.lead { font-size: 1.1rem; color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; margin: 16px 0;
}
ol.steps { padding-left: 1.4em; }
ol.steps li { margin: 0.5em 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 160px; resize: vertical; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label {
  font-weight: 500; margin: 0; padding: 10px 14px; border: 2px solid var(--line);
  border-radius: 8px; cursor: pointer; background: var(--card);
}
.radio-row label:has(input:checked) { border-color: var(--accent); }
.radio-row input { margin-right: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

button, .button {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent);
  border-radius: 8px; padding: 12px 22px; text-decoration: none; text-align: center;
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--err-ink); border-color: var(--err-ink); }
button.small { padding: 6px 12px; font-size: 0.85rem; }
button:disabled { opacity: 0.6; cursor: wait; }
form button[type=submit] { margin-top: 24px; width: 100%; font-size: 1.05rem; }

.msg { border-radius: 8px; padding: 14px 16px; margin: 16px 0; }
.msg.ok { background: var(--ok-bg); color: var(--ok-ink); }
.msg.err { background: var(--err-bg); color: var(--err-ink); }
.msg.warn { background: var(--warn-bg); color: var(--warn-ink); }
.hidden { display: none !important; }
footer.site { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px; }

/* admin */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  background: transparent; color: var(--muted); border: none; border-bottom: 3px solid transparent;
  border-radius: 0; padding: 10px 12px;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--bg); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill.pending, .pill.open { background: var(--warn-bg); color: var(--warn-ink); }
.pill.approved, .pill.resolved { background: var(--ok-bg); color: var(--ok-ink); }
.pill.rejected { background: var(--err-bg); color: var(--err-ink); }
.pill.in_progress, .pill.closed { background: var(--line); color: var(--ink); }
.pill.unknown { background: var(--err-bg); color: var(--err-ink); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar select { width: auto; }
pre.desc { white-space: pre-wrap; font: inherit; background: var(--bg); padding: 12px; border-radius: 8px; margin: 8px 0; }
.note { border-left: 3px solid var(--line); padding: 4px 12px; margin: 10px 0; }
.note .meta, .meta { color: var(--muted); font-size: 0.85rem; }
textarea.copy { min-height: 70px; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.card > label:first-child, .card > .hp + label { margin-top: 0; }
