:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --panel: #fff;
  --text: #1f2328;
  --muted: #4b5563;
  --line: #d8dee4;
  --accent: #1d2186;
  --gold: #caa85a;
  font-family: "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { width: min(1120px, calc(100% - 32px)); margin: 24px auto 48px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.3; }
h2 { font-size: 20px; margin-bottom: 16px; }
h3 { font-size: 17px; }
p { color: var(--muted); line-height: 1.7; }
.topline { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.worker { min-width: 180px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.worker span, .worker small { display: block; color: var(--muted); font-size: 12px; }
.worker strong { display: block; margin: 4px 0; }
.worker-form { margin-top: 8px; }
.worker-form button, .run-link { min-height: 32px; width: 100%; font-size: 13px; margin-top: 8px; }
.run-link { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); text-decoration: none; background: #fff; font-weight: 700; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.notice, .error { padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; }
.notice { background: #e8f5ee; border: 1px solid #9ad0b2; }
.error { background: #fff1f0; border: 1px solid #ffb4ad; }
label { display: block; font-weight: 700; margin-bottom: 14px; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--text); }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.55; }
button, .back, .job-head a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.job { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; }
.job-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
video { width: 100%; background: #eef1f4; border-radius: 6px; }
.main-video { max-height: 70vh; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f6f8fa; }
.runlog { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 12px; min-height: 160px; color: var(--text); }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.progress-meta strong { font-size: 16px; }
.progress-meta span { font-weight: 700; color: var(--accent); }
.progressbar { height: 14px; background: #e8ebef; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progressbar div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .25s ease; }
.status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; }
.status-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fafbfc; min-width: 0; }
.status-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.status-grid dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.hint { margin-top: 12px; }
.prompt-list { display: grid; gap: 10px; }
.prompt-item { border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; overflow: hidden; }
.prompt-item summary { cursor: pointer; padding: 10px 12px; font-weight: 700; color: var(--accent); }
.prompt-item pre { margin: 0; padding: 12px; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); background: #fff; }
.revision-form { margin-top: 14px; }
@media (max-width: 780px) {
  main { width: min(100% - 20px, 1120px); }
  .topline { display: block; }
  .worker { margin-top: 12px; }
  .grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
}
.job-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delete-form { margin: 0; }
button.danger { background: #b4232b; }
button.danger:hover { background: #8e1a21; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gcard { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.gcard h3 { margin: 10px 0 4px; font-size: 15px; overflow-wrap: anywhere; }
.gmeta { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.glinks { margin: 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.glinks a { color: var(--accent); font-weight: 700; }
.node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.node-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.node-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.node-title h2 { margin: 0 0 4px; }
.node-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: #f7efd9; color: #6e5100; font-size: 12px; font-weight: 700; }
.metric-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.metric-row span { color: var(--muted); }
.metric-row strong { color: var(--accent); font-size: 18px; }
.node-status { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rule-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rule-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fafbfc; }
.rule-grid strong { display: block; margin-bottom: 6px; color: var(--accent); }
code { padding: 2px 5px; border-radius: 4px; background: #eef1f4; color: var(--text); }
small { color: var(--muted); }
@media (max-width: 900px) {
  .node-grid, .rule-grid { grid-template-columns: 1fr; }
  .node-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
