:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --card: #fff;
  --line: #e3e6ea;
  --text: #1f2328;
  --muted: #6b7280;
  --accent: #1a56b8;
  --warn-bg: #fff8e1; --warn-fg: #8a6d00;
  --ok-bg: #e6f4ea;   --ok-fg: #137333;
  --bad-bg: #fce8e6;  --bad-fg: #c5221f;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6; font-size: 14px;
}
a { color: var(--accent); }

header {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
/* 幅が足りないときに文字が縦積みにならないようにする */
header .brand, header nav a, header .me { white-space: nowrap; }
header .brand { font-weight: 700; font-size: 15px; }
header nav { display: flex; gap: 16px; }
header nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
header nav a.on { color: var(--accent); }
header .me { margin-left: auto; color: var(--muted); font-size: 13px; }

main { max-width: 1080px; margin: 0 auto; padding: 24px; }

@media (max-width: 720px) {
  header { padding: 10px 16px; gap: 10px 16px; }
  header .me { margin-left: 0; width: 100%; }
  main { padding: 16px; }
}
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 0 0 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field.grow { flex: 1 1 220px; }

input[type=text], input[type=date], input[type=email], select, textarea {
  padding: 8px 10px; border: 1px solid #d7dbe0; border-radius: 6px; font: inherit; background: #fff;
}
textarea { min-height: 64px; resize: vertical; }

button {
  padding: 8px 16px; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
button.ghost { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--bad-fg); border-color: #f0b4b0; }
button:disabled { opacity: .5; cursor: default; }
button.sm { padding: 4px 10px; font-size: 13px; }

/* 列が多いので、狭い画面ではカードの中だけ横スクロールさせる */
.card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.pill.wait { background: var(--warn-bg); color: var(--warn-fg); }
.pill.ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad-fg); }
.pill.mute { background: #eef0f2; color: var(--muted); }

.bar { height: 6px; background: #eceff2; border-radius: 999px; overflow: hidden; min-width: 120px; }
.bar > i { display: block; height: 100%; background: var(--ok-fg); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.err { background: var(--bad-bg); color: var(--bad-fg); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; }
.ok  { background: var(--ok-bg);  color: var(--ok-fg);  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; }
pre.preview {
  background: #fafbfc; border: 1px solid var(--line); border-radius: 6px;
  padding: 14px; white-space: pre-wrap; word-break: break-word; font-size: 13px; margin: 0;
  max-height: 340px; overflow: auto;
}
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { font-weight: 400; font-size: 13px; display: flex; align-items: center; gap: 4px; }
