:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5b6168;
  --accent: #1d5fa8;
  --accent-text: #ffffff;
  --danger: #b42318;
  --success: #1a7f37;
  --border: #d9d6cf;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 18px;
  line-height: 1.7;
}
.page { margin: 0 auto; padding: 20px 16px 32px; }
.narrow { max-width: 560px; }
.wide { max-width: 1100px; }
h1 { font-size: 1.5rem; line-height: 1.4; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
.eyebrow { color: var(--muted); font-size: .9rem; margin: 0; }
.lead { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  margin: 16px 0;
}
.counter {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 16px 0;
  text-align: center;
  position: sticky;
  top: 8px;
  z-index: 2;
}
.counter p { margin: 0; }
.counter-main { font-size: 1.15rem; }
.counter-main strong { font-size: 1.8rem; }
.counter-sub strong { font-size: 1.4rem; }
.notice {
  background: #fff4e5;
  border: 2px solid #f0a020;
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 700;
}
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
input, select {
  font: inherit;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.button {
  font: inherit;
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.button.danger { color: var(--danger); border-color: var(--danger); }
.button.big { width: 100%; min-height: 60px; font-size: 1.2rem; }
.link-button { font: inherit; background: none; border: none; color: var(--accent); text-decoration: underline; padding: 8px 0; cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }
.message { min-height: 1.5em; font-weight: 700; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.progress-text { font-size: 1.3rem; font-weight: 700; margin: 0 0 8px; text-align: center; }
progress { width: 100%; height: 22px; }
.failed-list { color: var(--danger); padding-left: 1.2em; }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay[hidden] { display: none; }
.overlay-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 18px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.notice-list { padding-left: 1.2em; }
.notice-list li { margin-bottom: 8px; }
.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }

/* 管理画面（PC向け） */
body.admin { font-size: 16px; }
.admin-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.url-box code { word-break: break-all; font-size: .85rem; }
.stack-form { display: grid; gap: 10px; max-width: 480px; }
.inline-form { display: flex; gap: 8px; align-items: end; }
.inline-form input { width: 120px; }
