:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --text: #24231f;
  --muted: #767066;
  --accent: #1a6b4a;
  --accent-dark: #144f37;
  --accent-soft: #e8f2ec;
  --border: #e4e1d8;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn: #92600a;
  --warn-soft: #fff4e5;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.04), 0 2px 8px rgba(30, 25, 15, 0.05);
  --shadow-hover: 0 4px 14px rgba(30, 25, 15, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.icon { flex-shrink: 0; vertical-align: -3px; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 72px;
}

.wide { max-width: 1000px; }

header.site-header {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 16px 20px;
}
header.site-header .header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
header.site-header a {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 { font-size: 1.4rem; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
h2 {
  font-size: 1rem;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 7px;
  font-size: 0.95rem;
}

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.field-row .field { flex: 1 1 220px; margin-bottom: 22px; }

input[type=text], input[type=password], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: #b7b2a6; }

textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

.input-wrapper { position: relative; }
.input-wrapper input { padding-right: 42px; }
.input-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  margin: 0;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.input-toggle:hover { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23767066' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* --- 評価・選択式（共通のピル型ボタン） --- */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice-group label.choice-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-weight: 500;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.choice-group label.choice-pill-num {
  min-width: 42px;
  padding: 9px 0;
}
.choice-group label.choice-pill:hover { border-color: var(--accent); }
.choice-group input:checked + label.choice-pill {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.12s, box-shadow 0.12s, transform 0.05s;
}
button:hover, .btn:hover { background: var(--accent-dark); box-shadow: var(--shadow-hover); }
button:active, .btn:active { transform: translateY(1px); }

.btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent-soft); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1e18; }

.btn-icon-only { padding: 10px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }

.muted { color: var(--muted); font-size: 0.9rem; }
.muted-inline { color: var(--muted); font-weight: 400; font-size: 0.85em; }

.notice, .error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.notice { background: var(--warn-soft); border: 1px solid #f0c36d; color: var(--warn); }
.notice .icon, .error .icon { margin-top: 3px; }
.error { background: var(--danger-soft); border: 1px solid #f5b4ae; color: var(--danger); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.85rem;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f7f6f2;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
}
tbody tr:hover { background: #fbfaf7; }

nav.admin-nav {
  margin-bottom: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
nav.admin-nav a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}
nav.admin-nav a:hover { color: var(--accent); }
nav.admin-nav a.back { color: var(--accent); font-weight: 600; }

.store-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.store-list li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  transition: box-shadow 0.15s;
}
.store-list li:hover { box-shadow: var(--shadow-hover); }
.store-name { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; }
.store-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.question-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  background: #fbfaf7;
  position: relative;
}
.question-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.question-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.toggle-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text);
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .switch {
  width: 36px; height: 20px;
  background: #d9d5c9;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.toggle input:checked ~ .switch { background: var(--accent); }
.toggle input:checked ~ .switch::after { transform: translateX(16px); }
.toggle.danger input:checked ~ .switch { background: var(--danger); }

.copy-box {
  background: #fafaf8;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  white-space: pre-wrap;
}

.small { font-size: 0.8rem; }

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 14px;
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.lang-switch a.active { color: var(--accent); font-weight: 700; border-color: var(--border); background: #fff; }
.lang-switch a:hover { color: var(--accent); }

.login-box { max-width: 380px; margin: 64px auto 0; text-align: center; }
.login-box .lock-badge {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.login-box h1 { justify-content: center; }
.login-box form { text-align: left; margin-top: 20px; }
.login-box button { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-green { background: var(--accent-soft); color: var(--accent-dark); }
.badge-gray { background: #efede6; color: var(--muted); }
.badge-blue { background: #e7f0fb; color: #1a5b9c; }
.badge-red { background: var(--danger-soft); color: var(--danger); }

.response-list { display: grid; gap: 14px; }
.response-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.response-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.response-date { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.response-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.review-block {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.review-block-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.review-block p { margin: 0; white-space: pre-wrap; line-height: 1.65; }

details.qa-details { margin-top: 6px; }
details.qa-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 0;
  list-style: revert;
}
details.qa-details summary:hover { color: var(--accent-dark); }
details.qa-details[open] summary { margin-bottom: 8px; }

.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 20px;
}
.qa-item { font-size: 0.88rem; padding: 8px 0; border-top: 1px solid var(--border); }
.qa-item:nth-child(-n+2) { border-top: none; }
.qa-question { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 2px; }
.qa-answer { display: block; color: var(--text); }

details.draft-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 0;
  list-style: revert;
}
details.draft-details p {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: pre-wrap;
  margin: 6px 0 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .icon { width: 32px; height: 32px; margin-bottom: 10px; }

.mode-choice { display: grid; gap: 14px; }
.mode-option {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font: inherit;
  width: 100%;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.mode-option:hover, .mode-option:focus, .mode-option:active {
  background: var(--card);
  color: inherit;
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.mode-option-title { font-size: 1.05rem; font-weight: 700; color: var(--accent-dark); margin-bottom: 4px; }
.mode-option-desc { color: var(--muted); font-size: 0.9rem; }
.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.back-link:hover, .back-link:focus, .back-link:active {
  background: none;
  color: var(--accent-dark);
  box-shadow: none;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .store-list li { flex-direction: column; align-items: stretch; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn, .actions button { width: 100%; }
}
