:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --border: #dfe3e8;
  --text: #1f2933;
  --muted: #6b7480;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #15803d;
  --err: #b91c1c;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 32px 16px;
}
h1 { font-size: 22px; margin: 0 0 4px; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.container { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.topbar-user a { color: var(--accent); text-decoration: none; }
.topbar-user form { display: inline; }
.link-btn {
  background: none; border: none; color: var(--accent); font-size: 13px;
  font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
}
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
fieldset { border: none; padding: 0; margin: 0 0 16px; }
legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.checks label { font-size: 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.field label { font-size: 13px; font-weight: 600; }
input[type=date], input[type=time], input[type=text], input[type=password], select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
}
.radios { display: flex; gap: 14px; }
.radios label { font-size: 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button:disabled { background: #a3aab3; cursor: not-allowed; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.result { margin-top: 14px; font-size: 13px; }
.result .ok { color: var(--ok); }
.result .err { color: var(--err); }
.result ul { margin: 6px 0 0; padding-left: 18px; }
.status-line { font-size: 12px; color: var(--muted); margin-top: 6px; }

.login-wrap { max-width: 360px; margin: 80px auto 0; }
.login-wrap .card { display: flex; flex-direction: column; gap: 14px; }
.error-msg { color: var(--err); font-size: 13px; margin: 0; }

table.runs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.runs th, table.runs td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.runs th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-ok { background: #dcfce7; color: var(--ok); }
.badge-error { background: #fee2e2; color: var(--err); }
.badge-partial { background: #fef3c7; color: #92400e; }
.file-list { margin: 0; padding-left: 16px; }
.empty-state { color: var(--muted); font-size: 13px; }

.month-group { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.month-group summary {
  cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px;
  background: var(--bg); list-style: none;
}
.month-group summary::-webkit-details-marker { display: none; }
.month-group summary::before { content: "▸ "; color: var(--muted); }
.month-group[open] summary::before { content: "▾ "; }
.month-group table.runs { margin: 0; }
.month-group summary + table.runs th:first-child,
.month-group summary + table.runs td:first-child { padding-left: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs .tab {
  padding: 8px 16px; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.progress-bar { background: var(--border); border-radius: 6px; height: 10px; overflow: hidden; }
.progress-fill { background: var(--accent); height: 100%; width: 0%; transition: width 0.3s; }

.key-value-box {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px;
  padding: 12px 14px; font-family: monospace; font-size: 13px; word-break: break-all;
  margin-bottom: 16px;
}
table.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
table.keys th, table.keys td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
table.keys th { color: var(--muted); font-weight: 600; }
.small-btn { padding: 4px 10px; font-size: 12px; }
code.snippet { display: block; background: #1f2933; color: #e5e7eb; padding: 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; }
