* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: #f4f5f7;
  color: #222;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #2f6fed;
  color: white;
  flex-wrap: wrap;
}
.topnav a { color: white; text-decoration: none; font-size: 14px; }
.topnav .brand { font-weight: bold; font-size: 16px; margin-right: 6px; }
.logout-form { margin-left: auto; }
.logout-form button {
  background: none; border: 1px solid white; color: white;
  border-radius: 6px; padding: 4px 10px; font-size: 13px;
}
.container { max-width: 640px; margin: 0 auto; padding: 16px; }

.login-box { max-width: 320px; margin: 60px auto; text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login-box input { padding: 12px; font-size: 16px; border: 1px solid #ccc; border-radius: 8px; }
.login-box button { padding: 12px; font-size: 16px; background: #2f6fed; color: white; border: none; border-radius: 8px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash-error { background: #fde2e1; color: #a4231e; }
.flash-success { background: #e1f6e6; color: #1c6b30; }
.flash-info { background: #e6effe; color: #1a4fb0; }

h1, h2 { margin-top: 0; }

.card {
  background: white; border-radius: 12px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

form.stack { display: flex; flex-direction: column; gap: 12px; }
form.stack label { font-size: 13px; color: #555; font-weight: 600; }
form.stack input, form.stack select, form.stack textarea {
  width: 100%; padding: 10px; font-size: 15px; border: 1px solid #ccc; border-radius: 8px;
  font-family: inherit;
}
form.stack textarea { min-height: 100px; resize: vertical; }
.hint { font-size: 12px; color: #888; margin-top: -6px; }

.btn {
  display: inline-block; padding: 12px 18px; border-radius: 8px; border: none;
  font-size: 15px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: #2f6fed; color: white; }
.btn-secondary { background: #e5e8ee; color: #333; }
.btn-danger { background: #e05353; color: white; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-予約 { background: #fff3cd; color: #8a6d1a; }
.status-完了 { background: #e1f6e6; color: #1c6b30; }
.status-エラー { background: #fde2e1; color: #a4231e; }
.status-キャンセル { background: #eee; color: #888; }
.status-running { background: #fff3cd; color: #8a6d1a; }
.status-done { background: #e1f6e6; color: #1c6b30; }
.status-error { background: #fde2e1; color: #a4231e; }

.job-list { display: flex; flex-direction: column; gap: 8px; }
.job-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px; border-radius: 8px; background: #f4f5f7; text-decoration: none; color: inherit; font-size: 14px; }

table.queue-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.queue-table th, table.queue-table td { padding: 8px 6px; border-bottom: 1px solid #eee; text-align: left; }

.roster-list { font-size: 14px; line-height: 1.9; }
.roster-list .boy { color: #888; }

.image-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 8px;
}
.image-tile {
  position: relative; border-radius: 8px; overflow: hidden; border: 3px solid transparent; cursor: pointer;
}
.image-tile img { width: 100%; height: 90px; object-fit: cover; display: block; }
.image-tile.selected { border-color: #2f6fed; }
.image-tile .check { position: absolute; top: 4px; right: 4px; background: #2f6fed; color: white;
  border-radius: 50%; width: 20px; height: 20px; display: none; align-items: center; justify-content: center; font-size: 12px; }
.image-tile.selected .check { display: flex; }

video.preview { width: 100%; border-radius: 12px; background: black; }

.log-list { font-size: 12px; color: #555; font-family: ui-monospace, monospace; white-space: pre-wrap; }

.job-status { font-size: 14px; padding: 10px; border-radius: 8px; background: #eef1f7; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #ccc; border-top-color: #2f6fed;
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
