/* ── みんなチェック CSS ── */

:root {
  color-scheme: light;
  --primary: #E8551F;
  --primary-dark: #C9441A;
  --primary-light: #FFF1EB;
  --primary-text: #B5421A;
  --success: #1E7E34;
  --success-light: #E6F4EA;
  --danger: #DC3545;
  --warning: #FFC107;
  --info: #1976D2;
  --info-light: #E3F2FD;
  --warning-light: #FFF8E1;
  --warning-border: #FFD54F;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #767676;
  --bg: #F5F5F5;
  --white: #FFFFFF;
  --border: #DEE2E6;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --section-gap: 40px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 56px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 32px;
  --leading-tight: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Container ── */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ── */

/* ── Site Nav ── */

.site-nav {
  background: var(--white);
  border-bottom: 3px solid var(--primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-logo:hover {
  color: var(--primary-dark);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav-menu li a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Page Header ── */

.header {
  background: var(--white);
  padding: 12px 0;
  text-align: center;
}

.header-compact {
  padding: 12px 0;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.logo-sm {
  font-size: 20px;
}

.logo-check {
  color: var(--primary);
  font-weight: 900;
}

.tagline {
  color: var(--text-light);
  font-size: 15px;
  margin-top: 4px;
}

/* ── Cards ── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 16px 0;
  transition: box-shadow 0.3s ease;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* ── Steps ── */

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.step:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.step-number {
  background: var(--primary);
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ── Section Title ── */

.section-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text);
}

/* ── Forms ── */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.required {
  color: var(--danger);
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--white);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* フォーム要素: outlineを消してborder-color + box-shadowで代替 */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 85, 31, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.help-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Category Grid ── */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.category-option input[type="radio"] {
  display: none;
}

.category-card {
  display: block;
  padding: 12px 8px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  position: relative;
}

.category-option input:checked + .category-card {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.category-card:hover {
  border-color: var(--primary);
}

/* ── Buttons ── */

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 8px rgba(232, 85, 31, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(232, 85, 31, 0.4);
}

.btn-primary:disabled {
  background: #B0B0B0;
  color: #F5F5F5;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary:disabled {
  border-color: #ccc;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.dynamic-item .btn-remove:disabled {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

input:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.btn-large {
  width: 100%;
  padding: 18px;
  font-size: 18px;
}

.btn-secondary {
  display: inline-block;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary:active {
  transform: scale(0.97);
  background: var(--primary-text);
  box-shadow: 0 1px 4px rgba(232, 85, 31, 0.3);
}

.btn-secondary:active {
  transform: scale(0.97);
  background: var(--bg);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 14px;
}

.btn-copy {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.form-actions {
  margin-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ── Option / Fee items ── */

.dynamic-item {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.dynamic-item input {
  flex: 1;
  min-width: 0;
}

.dynamic-item select {
  width: auto;
  flex-shrink: 0;
}

.dynamic-item .btn-remove {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 22px;
  cursor: pointer;
  padding: 8px 12px;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Name Grid (check-in) ── */

.name-search {
  margin-bottom: 12px;
}

.name-search input {
  border-radius: 24px;
  padding: 10px 20px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.name-btn {
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

@media (hover: hover) {
  .name-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
  }
}

.name-btn:active {
  transform: scale(0.95);
}

.name-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.name-btn .name-emoji {
  font-size: 24px;
}

.name-btn .name-text {
  font-size: 12px;
  font-weight: 600;
}

.selected-name {
  text-align: center;
  margin: 12px 0;
  font-size: 16px;
  color: var(--primary-text);
}

/* ── Checkin Options ── */

.checkin-option {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.checkin-option label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.checkin-option .toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Edit Banner ── */

.edit-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--info-light);
  border: 2px solid var(--info);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.edit-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.edit-banner strong {
  font-size: 16px;
  color: #1565C0;
}

.edit-banner p {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Fees ── */

.fees-list {
  margin-bottom: 8px;
}

.fee-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.fee-item-interactive {
  flex-wrap: wrap;
  gap: 6px;
}

.fee-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.fee-payment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 2px solid #FFD54F;
}

@media (max-width: 480px) {
  .fee-item-interactive {
    flex-direction: column;
    align-items: stretch;
  }
  .fee-payment {
    border-left: none;
    border-top: 1px solid #FFD54F;
    padding-left: 0;
    padding-top: 8px;
  }
}

.fee-paid-label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  cursor: pointer;
}

.fee-admin-badge {
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.fee-label {
  font-weight: 600;
  font-size: 15px;
}

.fee-amount {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-text);
}

/* ── Toggle Switch ── */

.toggle {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CCC;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--success);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

/* ── Result Section ── */

.result-card {
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: var(--white);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.result-event-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}

.result-block {
  margin: 24px 0;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.result-block h3 {
  margin-bottom: 12px;
}

.warning-block {
  background: var(--warning-light);
  border: 2px solid #F9A825;
  border-radius: var(--radius);
}

/* ── カレンダー登録ブロック ── */
.calendar-block {
  border: 1px solid var(--border);
}

.calendar-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-calendar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.15s, box-shadow 0.15s;
}

.btn-google-cal {
  background: #fff;
  color: #1a73e8;
  border-color: #1a73e8;
}

.btn-google-cal:hover {
  background: #e8f0fe;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.2);
}

.btn-ics {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-ics:hover {
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google-cal:active,
.btn-ics:active {
  transform: scale(0.97);
}

.calendar-note {
  margin-top: 8px;
  font-size: 12px;
}

.warning-block .help-text {
  color: #D84315;
  font-weight: 700;
  font-size: 14px;
  background: #FBE9E7;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--danger);
  margin-bottom: 12px;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
}

.qr-container img,
.qr-container canvas {
  max-width: 280px;
  width: 100%;
}

.result-url {
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-all;
  margin-top: 8px;
}

.url-box {
  display: flex;
  margin-top: 8px;
}

.url-box input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  flex: 1;
  font-size: 13px;
}

/* ── Center Messages ── */

.center-message {
  text-align: center;
  padding: 60px 20px;
}

.center-message h2 {
  margin: 16px 0 8px;
}

.center-message p {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--white);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.warning-icon {
  font-size: 48px;
  margin: 0 auto;
}

/* ── Success Animation (check-in done) ── */

.success-animation {
  margin-bottom: 16px;
}

.success-icon-large {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--success);
  color: var(--white);
  font-size: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: pop 0.4s ease-out;
}

@keyframes pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.done-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-text);
  margin-top: 12px;
}

.done-event {
  color: var(--text-light);
}

/* ── Spinner ── */

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Admin ── */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-header h2 {
  font-size: 22px;
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-active {
  background: var(--success-light);
  color: var(--success);
}

.badge-upcoming {
  background: #E3F2FD;
  color: #1976D2;
}

.badge-ended {
  background: #F5F5F5;
  color: var(--text-muted);
}

.event-meta {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-light);
}

/* ── Data Table ── */

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover {
  background: var(--primary-light);
}

.pay-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--white);
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 36px;
}

.pay-btn.paid {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

@media (hover: hover) {
  .pay-btn:hover {
    transform: scale(1.05);
  }
}

.paid-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

.paid-badge-admin {
  background: #E3F2FD;
  color: #1565C0;
}

.paid-badge-user {
  background: #FFF3E0;
  color: #E65100;
}

/* ── Done Payments ── */

.done-payments {
  margin-top: 16px;
  text-align: left;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.done-payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #F5F5F5;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 14px;
}

.done-paid {
  color: var(--success);
  font-weight: 700;
}

.done-unpaid {
  color: #999;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* ── Payment Summary ── */

.payment-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.payment-summary-item:last-child {
  border-bottom: none;
}

.payment-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  width: 100px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.3s;
}

/* ── Features Grid ── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: var(--space-lg) 0;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) {
  .feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
  }
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 10px;
  line-height: 1.2;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.feature-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ── How-to Steps ── */

.howto-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin: 8px 0 0;
}

/* 案内文ブロック */
.event-announcement {
    background: var(--warning-light);
    border: 1px solid var(--warning-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1rem;
}
.announcement-icon {
    font-size: 1.2rem;
}
.announcement-body {
    color: #333;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.howto-step {
  flex: 1;
  text-align: center;
  padding: 0 12px;
  max-width: 220px;
}

.howto-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.howto-icon {
  font-size: 40px;
  margin-bottom: 10px;
  line-height: 1.2;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.howto-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.howto-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.howto-arrow {
  color: var(--primary);
  font-size: 20px;
  flex-shrink: 0;
  padding-top: 48px;
  opacity: 0.6;
}

/* ── Footer ── */

.footer {
  background: var(--white);
  border-top: 2px solid var(--border);
  text-align: center;
  padding: 40px 0 32px;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 56px;
}

.footer-link {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ── Release Notes ── */

.release-notes {
  margin: 2rem auto;
}

.release-notes h3 {
  border-bottom: 2px solid var(--success);
  padding-bottom: 0.5rem;
}

.release-notes .release-date {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.release-notes ul {
  line-height: 2;
}

.release-notes .release-version {
  margin-bottom: 2rem;
}

.release-notes .release-actions {
  text-align: center;
  margin-top: 2rem;
}

.logo a {
  text-decoration: none;
  color: inherit;
}

/* ── Utilities ── */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-heading {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin: 24px 0 8px;
  color: var(--text);
}

/* ── Form Validation ── */

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: var(--danger);
  background: #FFF5F5;
}

.form-group .error-message {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
  display: none;
}

.form-group.has-error .error-message {
  display: block;
}

/* ── Section Spacing ── */

#about-section,
#howto-section,
#create-form-section {
  margin-bottom: var(--section-gap);
}

/* ── Admin Container ── */

.container.admin-container {
  max-width: 960px;
}

/* ── Hero Section ── */

.hero {
  background: linear-gradient(135deg, #FFF1EB 0%, #FFECD2 40%, var(--white) 100%);
  padding: 56px 0 48px;
  text-align: center;
}

.hero-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-light);
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero-cta {
  display: inline-block;
  padding: 16px 40px;
  font-size: 18px;
}

/* ── Scroll Fade-in (Progressive Enhancement) ── */
/* デフォルトは表示。JSが動作する場合のみアニメーション有効化 */

.js .fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 安全フォールバック：3秒後のJS強制表示用 */
.js .fade-in-up.force-visible {
  opacity: 1;
  transform: translateY(0);
  transition: none;
}

/* ── モーション軽減設定への対応 ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade-in-up { opacity: 1; transform: none; transition: none; }
  .success-icon-large { animation: none; }
  .spinner { animation: spin 3s linear infinite; }
  .feature-card { transition: none; }
  .btn-loading::after { animation: none; }
  .nav-menu.open { animation: none; }
}

/* ── Responsive ── */

@media (max-width: 768px) {
  :root { --section-gap: 28px; }
  .hero { padding: 32px 0 28px; }
  .hero-title { font-size: 22px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .howto-steps { flex-direction: column; align-items: center; }
  .howto-arrow { display: none; }
  .howto-step { max-width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .howto-step:last-child { border-bottom: none; }
  .howto-number { margin: 0; flex-shrink: 0; }
  .howto-icon { font-size: 36px; margin-bottom: 0; flex-shrink: 0; }
  .howto-title { font-size: 15px; margin-bottom: 2px; }
  .howto-desc { font-size: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .name-grid { max-height: 360px; overflow-y: auto; }
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 8px 16px;
    border-bottom: 2px solid var(--border);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  }
  .nav-menu.open { display: flex; animation: slideDown 0.2s ease; }
  .nav-menu li a { padding: 12px 16px; font-size: 15px; }
  .nav-menu li a[aria-current="page"]::after { display: none; }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 480px) {
  .name-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 16px;
    margin: 12px 0;
  }

  .admin-header {
    flex-direction: column;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }
}

/* ── Print ── */

@media print {
  body {
    background: white;
  }

  .header, .hero, .footer, .site-nav, .btn-primary, .btn-secondary, .btn-row,
  .form-actions, #about-section, #howto-section, .calendar-block {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .qr-container img {
    max-width: 300px;
  }
}

/* ── Legal / Static Pages ── */

.legal-page {
  padding: 32px 24px;
  margin: 24px 0;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: var(--bg);
  font-weight: 600;
  white-space: nowrap;
  min-width: 100px;
}

.legal-page h1 {
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.legal-page h2 {
  font-size: 18px;
  margin-top: 32px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--text);
}

.legal-page h3 {
  font-size: 15px;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.legal-page p {
  margin-bottom: 12px;
  line-height: 1.8;
}

.legal-page ul,
.legal-page ol {
  margin: 8px 0 16px 24px;
  line-height: 1.8;
}

.legal-page li {
  margin-bottom: 4px;
}

.legal-back {
  margin-top: 40px;
  text-align: center;
}

/* ── Contact Page ── */

.contact-form {
  margin: 24px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 85, 31, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  text-align: center;
  margin-top: 24px;
}

.btn-lg {
  padding: 14px 48px;
  font-size: 16px;
}

.contact-error {
  background: #FDE8E8;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}

.contact-success {
  text-align: center;
  padding: 40px 16px;
  background: var(--success-light);
  border-radius: var(--radius);
  margin: 24px 0;
}

.contact-success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.contact-success h2 {
  margin-bottom: 8px;
  color: var(--text);
}

.contact-success p {
  margin-bottom: 8px;
}

/* ── Contact Admin ── */

.contacts-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-light);
  background: var(--white);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.contact-card:hover {
  box-shadow: var(--shadow);
}

.contact-unread {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
}

.contact-card-header {
  padding: 14px 16px;
  cursor: pointer;
}

.contact-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.contact-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.status-unread {
  background: var(--primary);
  color: var(--white);
}

.status-read {
  background: var(--info-light);
  color: var(--info);
}

.status-replied {
  background: var(--success-light);
  color: var(--success);
}

.status-closed {
  background: var(--bg);
  color: var(--text-muted);
}

.contact-category-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--warning-light);
  color: #795548;
  font-weight: 600;
}

.contact-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.contact-card-preview {
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.contact-name {
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.contact-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-detail {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.contact-detail-info {
  padding: 12px 0;
}

.detail-row {
  font-size: 14px;
  margin-bottom: 4px;
}

.detail-row a {
  color: var(--primary);
}

.contact-detail-message {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.message-body {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-detail-note {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.note-body {
  margin-top: 8px;
  padding: 12px;
  background: var(--warning-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning-border);
  font-size: 14px;
  line-height: 1.6;
}

.contact-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.contact-status-select {
  width: auto;
  min-width: 100px;
  padding: 6px 10px;
  font-size: 13px;
}

.contact-note-form {
  margin-top: 12px;
}

.note-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-info {
  font-size: 14px;
  color: var(--text-light);
}

.badge-unread {
  display: inline-block;
  background: var(--danger);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}

.stat-card-alert {
  border: 2px solid var(--primary);
  background: var(--primary-light);
}

/* ── About Page ── */

.about-section {
  margin-bottom: 32px;
}

.about-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.about-table th,
.about-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.about-table th {
  width: 140px;
  background: var(--bg);
  font-weight: 600;
  white-space: nowrap;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.use-case-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
}

.use-case-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.use-case-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
  border: none;
  padding: 0;
}

.use-case-card p {
  font-size: 13px;
  color: var(--text-light);
  margin: 0;
}

@media (max-width: 480px) {
  .use-cases-grid {
    grid-template-columns: 1fr;
  }
}

/* ── FAQ Page ── */

.faq-page h2 {
  margin-top: 24px;
}

.faq-category {
  margin-bottom: 24px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  background: var(--white);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-question::before {
  content: "▶";
  font-size: 11px;
  color: var(--primary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

details[open] > .faq-question::before {
  transform: rotate(90deg);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-answer {
  padding: 0 16px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.faq-answer p,
.faq-answer ul,
.faq-answer ol {
  margin-top: 12px;
}

.faq-contact {
  margin-top: 32px;
  padding: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  text-align: center;
}

.faq-contact h2 {
  border: none;
  margin-top: 0;
}

/* ── Footer Nav ── */

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-top: 16px;
}

.footer-nav .footer-link {
  font-size: 14px;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ── フォーカスインジケータ (#3) ── */

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-copy:focus-visible,
.btn-calendar:focus-visible,
.name-btn:focus-visible,
.nav-menu li a:focus-visible,
.footer-link:focus-visible,
.pay-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ── ヒーローバッジ (#5) ── */

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── フォームCTAボタン (#7) ── */

.form-actions .btn-primary {
  width: 100%;
  max-width: 360px;
  padding: 16px 32px;
  font-size: 18px;
}

/* ── 現在ページ表示 (#10) ── */

.nav-menu li a.active,
.nav-menu li a[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary-dark);
  position: relative;
}

.nav-menu li a.active::after,
.nav-menu li a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* ── フォームバリデーション成功 (#13) ── */

.form-group.has-success input,
.form-group.has-success textarea,
.form-group.has-success select {
  border-color: var(--success);
}

.form-group.has-success label::after {
  content: ' ✓';
  color: var(--success);
  font-size: 14px;
}

/* ── ボタンローディング状態 (#14) ── */

.btn-loading {
  pointer-events: none;
  opacity: 0.8;
  position: relative;
}

.btn-loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── フッターブランド (#16) ── */

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-copyright {
  margin-top: 16px;
}



/* ── howto-icon統一 (#17) — 元の定義を更新済みのため重複削除 ── */

/* ── result-card影 (#18) ── */

.result-card {
  box-shadow: var(--shadow-lg);
}

#create-form-section .card {
  box-shadow: var(--shadow);
}

/* ── カテゴリチェックマーク (#21) ── */

.category-option input:checked + .category-card::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

/* ── スキップナビゲーション (#23) ── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  z-index: 10000;
  transition: top 0.2s;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}
