/* === リセット・ベース === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #F5A623;
  --primary-dark: #E0941A;
  --secondary: #1B2A4A;
  --bg: #FFF8F0;
  --success: #27AE60;
  --danger: #E74C3C;
  --text: #333;
  --text-light: #666;
  --border: #E8DDD2;
  --card-bg: #fff;
  --shadow: 0 4px 20px rgba(27, 42, 74, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* === 共通レイアウト === */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

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

/* === ボタン === */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #E8EDF2;
  color: #555;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* === トップページ（選択画面） === */
.top-hero {
  text-align: center;
  padding: 40px 0 24px;
}

.top-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

.top-logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
}

.top-logo span {
  color: var(--primary);
}

.top-subtitle {
  font-size: 14px;
  color: var(--text-light);
}

.app-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(27, 42, 74, 0.12);
}

.app-card-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.app-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}

.app-card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.app-card-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  background: #FFF3E0;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
}

/* === 診断アプリ共通: イントロ画面 === */
.intro-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.intro-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.intro-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
}

.intro-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 24px;
}

.intro-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-light);
}

.intro-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.start-btn {
  width: 100%;
  max-width: 280px;
  font-size: 17px;
  padding: 16px 32px;
}

/* === 診断アプリ共通: クイズ画面 === */
.quiz-header {
  padding: 16px 0;
}

.progress-info {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #FFD180);
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

.quiz-body {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.question-category {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.question-text {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 24px;
  color: var(--text);
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  width: 100%;
  padding: 14px 20px;
  background: #FFF8F0;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

@media (hover: hover) {
  .choice-btn:hover {
    border-color: var(--primary);
    background: #FFF3E0;
  }
}

.choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.choice-btn.disabled {
  pointer-events: none;
}

/* === 診断アプリ共通: 結果画面 === */
.result-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.result-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.result-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.result-level {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
}

/* 円グラフ */
.result-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chart-inner {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.result-percent {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}

.result-score {
  font-size: 13px;
  color: #888;
}

.result-message {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* レコメンドセクション */
.recommend-section {
  margin-top: 24px;
  text-align: left;
}

.recommend-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 12px;
  text-align: center;
}

.recommend-item {
  background: #FFF8F0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
}

.recommend-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.recommend-number {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.recommend-category {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
}

.recommend-advice {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  margin-left: 32px;
}

/* === シェアセクション === */
.share-section {
  margin-top: 24px;
}

.share-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 12px;
  text-align: center;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.share-btn {
  flex: 1;
  max-width: 120px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.share-btn:hover {
  border-color: var(--primary);
  background: #FFF3E0;
}

.share-btn-icon {
  font-size: 20px;
}

/* CTA */
.cta-section {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), #FFB74D);
  border-radius: 16px;
  text-align: center;
  color: #fff;
}

.cta-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid rgba(255, 255, 255, 0.4);
}

.cta-text {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.6;
}

.cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--primary-dark);
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s;
}

.cta-btn:hover {
  transform: translateY(-2px);
}

/* === アクションボタン === */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.result-actions .btn {
  width: 100%;
}

/* === フッター === */
.footer {
  text-align: center;
  padding: 24px 0;
  font-size: 12px;
  color: #999;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

/* === コピー完了トースト === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--secondary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* === アニメーション === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* === フォーム系アプリ共通 === */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input.input-error {
  border-color: var(--danger);
}

.form-input::placeholder {
  color: #bbb;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group {
  flex: 1;
}

.form-hint {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

/* === データカード === */
.data-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.data-card-body {
  flex: 1;
  min-width: 0;
}

.data-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.data-card-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.data-card-right {
  text-align: right;
  flex-shrink: 0;
}

.data-card-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--secondary);
}

.data-card-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.data-card-delete:hover {
  color: var(--danger);
}

/* === カレンダーグリッド === */
.calendar {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
}

.calendar-nav {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-light);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 8px;
  position: relative;
}

.calendar-day.today {
  font-weight: 700;
  color: var(--primary);
}

.calendar-day.other-month {
  color: #ddd;
}

.calendar-day.has-event {
  background: #FFF3E0;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
}

.calendar-day.has-event::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

/* === タブナビゲーション === */
.tab-nav {
  display: flex;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === 統計カード === */
.stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  flex: 1;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary);
}

.stat-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
}

/* === CSS棒グラフ === */
.bar-chart {
  margin: 16px 0;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.bar-label {
  width: 40px;
  font-size: 12px;
  color: var(--text-light);
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: #f0ebe4;
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #FFB74D);
  border-radius: 6px;
  transition: width 0.6s ease;
  min-width: 0;
}

.bar-value {
  width: 70px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

/* === メニュー表プレビュー === */
.menu-preview {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.menu-preview-header {
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.menu-preview-shop {
  font-size: 24px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.menu-preview-subtitle {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 2px;
}

.menu-category-section {
  margin-bottom: 20px;
  text-align: left;
}

.menu-category-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.menu-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dotted #e0d8cc;
}

.menu-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.menu-item-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.menu-item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--secondary);
  white-space: nowrap;
  margin-left: 12px;
}

/* === サンプルデータボタン === */
.sample-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #E8EDF2;
  color: #555;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}

.sample-btn:hover {
  background: #dce3ea;
}

/* === 動的追加エリア === */
.dynamic-list {
  margin-bottom: 16px;
}

.add-btn {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: none;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* === 空状態 === */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  line-height: 1.6;
}

/* === 予約リスト === */
.reservation-list {
  margin-top: 16px;
}

.reservation-item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}

.reservation-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.reservation-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.reservation-menu {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* === セクション区切り === */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--secondary);
  margin: 20px 0 10px;
}

/* === テーマ・カラー選択 === */
.theme-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.theme-card:hover {
  border-color: var(--primary);
}

.theme-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.25);
}

.theme-card-preview {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

.theme-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.color-swatches {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.3);
  transform: scale(1.1);
}

/* === レスポンシブ === */
@media (max-width: 480px) {
  .question-text {
    font-size: 15px;
  }

  .choice-btn {
    font-size: 14px;
    padding: 12px 16px;
  }

  .result-percent {
    font-size: 28px;
  }

  .top-logo {
    font-size: 24px;
  }

  .intro-title {
    font-size: 20px;
  }

  .stat-value {
    font-size: 18px;
  }

  .menu-preview {
    padding: 24px 16px;
  }

  .menu-preview-shop {
    font-size: 20px;
  }
}
