:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d9dde3;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --planned: #4b5563;
  --planned-bg: #e5e7eb;
  --ok: #047857;
  --ok-bg: #d1fae5;
  --busy: #1e40af;
  --busy-bg: #dbeafe;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px;
}
.header-inner { max-width: 880px; margin: 0 auto; }
.site-header h1 { margin: 0; font-size: 1.25rem; }
.back-link { color: var(--primary); text-decoration: none; font-size: 0.875rem; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--muted); }
.link-button { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.login-box { max-width: 420px; margin: 40px auto; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.field input { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.back-link:hover { text-decoration: underline; }

.container { max-width: 880px; margin: 24px auto; padding: 0 16px; }

/* トップ画面 */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.feature-card.status-planned { opacity: 0.75; }

.feature-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feature-head h2 { margin: 0; font-size: 1.05rem; }

.badge { font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.badge-available { color: var(--ok); background: var(--ok-bg); }
.badge-planned { color: var(--planned); background: var(--planned-bg); }

.note { color: var(--muted); font-size: 0.875rem; }

/* ボタン */
.button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.button:hover { background: var(--primary-hover); }
.button-secondary { background: var(--surface); color: var(--primary); }
.button-secondary:hover { background: var(--busy-bg); }
.button-primary { font-weight: bold; padding: 12px 28px; }
.button:disabled, .button:disabled:hover {
  background: var(--planned-bg); color: var(--muted); border-color: var(--planned-bg); cursor: not-allowed;
}

/* 作成画面 */
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.step h2 { font-size: 1.05rem; margin: 20px 0 8px; display: flex; align-items: center; gap: 10px; }
.step h2:first-child { margin-top: 0; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 0.9rem; flex-shrink: 0;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.hint { color: var(--muted); font-size: 0.875rem; margin: 6px 0 0; }

.file-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.file-picker input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker-button {
  padding: 8px 18px; border: 1px solid var(--primary); border-radius: 6px; color: var(--primary); background: var(--surface);
}
.file-picker input:focus-visible + .file-picker-button { outline: 3px solid var(--busy-bg); }
.file-name { color: var(--muted); word-break: break-all; }

.format-options { display: flex; flex-wrap: wrap; gap: 12px; }
.format-option {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 16px; cursor: pointer; background: var(--surface);
}
.format-option:has(input:checked) { border-color: var(--primary); background: var(--busy-bg); }

.status { margin-top: 16px; padding: 12px 16px; border-radius: 6px; }
.status-busy { color: var(--busy); background: var(--busy-bg); }
.status-done { color: var(--ok); background: var(--ok-bg); }

.error-box {
  margin-top: 16px; padding: 12px 16px; border-radius: 6px;
  background: var(--error-bg); border: 1px solid var(--error-border);
}
.error-message { color: var(--error); font-weight: bold; margin: 0 0 8px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; background: var(--surface); }
th, td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: var(--bg); white-space: nowrap; }
.error-table td:first-child, .error-table td:nth-child(2) { white-space: nowrap; }

.rules { margin-top: 12px; }
.rules summary { cursor: pointer; color: var(--primary); }
.rule-notes { padding-left: 20px; font-size: 0.9rem; }
.rule-table td:first-child { white-space: nowrap; font-weight: bold; }
code { background: var(--bg); padding: 0 4px; border-radius: 4px; }

.site-footer { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 24px 16px; }
