:root {
  color-scheme: dark light;
  --bg: #121218;
  --card: #1c1c26;
  --line: #2f2f40;
  --text: #f2f2f7;
  --dim: #a0a2b8;
  --accent: #5c4be0;
  --ok: #2fa36b;
  --warn: #d89b38;
  --err: #d85858;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f9;
    --card: #ffffff;
    --line: #dcdce8;
    --text: #181822;
    --dim: #5e6074;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 640px;
  margin: 0 auto;
  padding:
    calc(14px + env(safe-area-inset-top))
    calc(14px + env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    calc(14px + env(safe-area-inset-left));
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

h1 {
  font-size: 20px;
  margin: 0;
}

h2 {
  font-size: 16px;
  margin: 0 0 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

textarea, input[type="password"], input[type="text"] {
  width: 100%;
  font-size: 16px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

button, .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

button.secondary, .btn-link.secondary {
  background: #323244;
  color: #fff;
}

button.ok {
  background: var(--ok);
}

button.danger {
  background: #7c3030;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.row-actions > button {
  flex: 1;
  min-width: 120px;
}

.hint {
  font-size: 14px;
  color: var(--dim);
  margin: 8px 0 0;
}

.status-item, .video-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.status-item:first-child, .video-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.url-txt {
  font-size: 13px;
  color: var(--dim);
  word-break: break-all;
}

.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.badge.wait { background: #2d2f3e; color: #c8cae0; }
.badge.run  { background: #3b3578; color: #d8d2ff; }
.badge.done { background: #1e4d38; color: #96f0c0; }
.badge.skip { background: #4a3a1e; color: #f6ce80; }
.badge.fail { background: #522424; color: #ff9c9c; }

.msg-err { color: #ff8e8e; font-size: 14px; margin-top: 6px; }
.msg-ok  { color: #86e6b4; font-size: 14px; margin-top: 6px; }

/* 2026-11-30 画像取得 */
.opt { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 16px; min-height: 44px; }
.opt input { width: 22px; height: 22px; }
.thumb { display: block; max-width: 100%; max-height: 240px; margin-top: 8px; border-radius: 8px; object-fit: contain; }

/* 2026-11-30 動作環境の表示 */
.env-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.env-badge.home { background: #1f4d36; color: #9be6bd; }
.env-badge.cloud { background: #24345c; color: #a9c3ff; }
