/* ─── 全体設定・盗用防止（テキスト選択禁止） ─── */
*{box-sizing:border-box;margin:0;padding:0}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background-color: #f4f6f9;
  color: #333;
  padding: 1rem;
  line-height: 1.6;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ─── メインコンテナ（カードスタイル） ─── */
.screen {
  display: none;
  max-width: 780px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 2.5rem 2rem;
}
.screen.active { display: block; }
@media (max-width: 600px) {
  .screen { padding: 1.5rem 1rem; border-radius: 8px; }
}

/* ─── パンくずリスト ─── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 2rem;
  color: #64748b;
}
.breadcrumb a {
  color: #34495e;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: #6aaad8; text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; font-size: 11px; }
.breadcrumb .current { color: #94a3b8; font-weight: 400; }

/* ─── タイトル・ヘッダー ─── */
.cover-title {font-size:22px; font-weight:600; margin-bottom:10px; color:#2c3e50; letter-spacing: 0.5px;}
.cover-sub {font-size:14px; color:#666; margin-bottom:2rem; border-bottom: 2px solid #eee; padding-bottom: 1rem;}
.page-title {font-size:18px; font-weight:600; margin-bottom:6px; color:#2c3e50;}
.page-sub {font-size:13px; color:#7f8c8d; margin-bottom:1.5rem;}

/* ─── カバー画面のモード選択 ─── */
.mode-grid {display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:2rem;}
.mode-card {
  padding: 2rem 1rem; 
  border: 1px solid #e1e4e8; 
  border-radius: 8px; 
  cursor: pointer; 
  text-align: center; 
  background: #fff;
  transition: all 0.2s ease;
}
.mode-card:hover {
  border-color: #6aaad8;
  box-shadow: 0 4px 12px rgba(106, 170, 216, 0.15);
  transform: translateY(-2px);
}
.mode-sym {font-size:36px; margin-bottom:12px;}
.mode-label {font-size:15px; font-weight:600; margin-bottom:6px; color:#34495e;}
.mode-desc {font-size:12px; color:#7f8c8d; line-height:1.6;}
@media (max-width: 540px) {
  .mode-grid {grid-template-columns: 1fr;}
  .mode-card {padding: 1.5rem 1rem;}
}
.note-box {padding:14px 18px; border-left: 4px solid #6aaad8; border-radius:4px; font-size:13px; color:#555; background:#f8fafc;}

/* ─── アンケート画面 ─── */
.q-tabs {display:flex; gap:10px; margin-bottom:1.5rem;}
.q-tab {padding:8px 20px; border-radius:6px; border:1px solid #ddd; font-size:14px; font-weight:500; cursor:pointer; background:#fafafa; color:#7f8c8d; position:relative; transition: all 0.2s;}
.q-tab.active {background:#fff; color:#2c3e50; border-color:#6aaad8; box-shadow: 0 2px 6px rgba(106, 170, 216, 0.15);}
.tab-done {position:absolute; top:-8px; right:-8px; width:18px; height:18px; border-radius:50%; background:#27ae60; color:#fff; font-size:11px; display:flex; align-items:center; justify-content:center; box-shadow: 0 2px 4px rgba(0,0,0,0.1);}

/* ─── ★進捗バー（フロート追従） ─── */
.prog-wrap {
  position: -webkit-sticky;
  position: sticky;
  top: 1rem; /* 画面上部からの余白 */
  z-index: 100; /* 他の要素より手前に表示 */
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.95); /* 下の文字が透けすぎない白背景 */
  backdrop-filter: blur(6px); /* すりガラス効果 */
  -webkit-backdrop-filter: blur(6px);
  padding: 12px 16px; 
  border-radius: 8px; 
  border: 1px solid #e1e4e8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06); /* 浮き上がるようなシャドウ */
}
.prog-lbl {font-size:12px; font-weight:600; color:#475569; margin-bottom:8px; display:flex; justify-content:space-between;}
.prog-bar {height:6px; background:#e2e8f0; border-radius:3px; overflow:hidden;}
.prog-fill {height:6px; border-radius:3px; background:#6aaad8; transition:width 0.4s cubic-bezier(0.4, 0, 0.2, 1);}

/* ─── 設問リスト ─── */
.q-row {display:flex; align-items:center; gap:12px; margin-bottom:8px; padding:12px 16px; border:1px solid #e1e4e8; border-radius:8px; background:#fff; transition: background 0.2s;}
.q-row:hover {background:#fafbfc;}
.q-num {font-size:13px; font-weight:600; color:#95a5a6; min-width:24px;}
.q-text {font-size:14px; flex:1; line-height:1.5; color:#34495e;}

.pip-row {display:flex; gap:6px; flex-shrink:0;}
.pip {width:32px; height:32px; border-radius:6px; border:1px solid #cbd5e1; font-size:14px; font-weight:600; cursor:pointer; background:#fff; color:#94a3b8; display:flex; align-items:center; justify-content:center; transition: all 0.15s;}
.pip.on {border-color:currentColor;}
@media (max-width: 600px) {
  .q-row {flex-direction: column; align-items: flex-start; padding: 14px;}
  .pip-row {width: 100%; justify-content: space-between; margin-top: 8px;}
  .pip {width: 22%; height: 40px; font-size: 15px;}
}

.do-result-btn {display:flex; align-items:center; justify-content:center; width:100%; padding:16px; margin-top:2rem; border-radius:8px; border:none; font-size:16px; font-weight:600; cursor:pointer; background:#34495e; color:#fff; transition: all 0.2s; box-shadow: 0 4px 6px rgba(52, 73, 94, 0.2);}
.do-result-btn:hover:not(:disabled) {background:#2c3e50; transform: translateY(-1px);}
.do-result-btn:disabled {opacity:0.4; cursor:not-allowed; box-shadow:none;}

/* ─── 結果画面 ─── */
.result-layout {display:flex; gap:1.5rem; align-items:flex-start;}
.result-nav {flex:0 0 auto; width:160px; display:flex; flex-direction:column; gap:6px;}
.result-main {flex:1; min-width:0;}
.r-tab {padding:10px 14px; border-radius:6px; border:1px solid transparent; font-size:13px; font-weight:500; cursor:pointer; background:#f8fafc; color:#555; text-align:left; transition: all 0.2s;}
.r-tab:hover {background:#e2e8f0;}
.r-tab.active {background:#34495e; color:#fff;}
.r-tab.sub {font-size:12px; margin-left:12px; border-left:2px solid #cbd5e1; background:transparent;}
.r-tab.sub.active {border-left-color:#34495e; font-weight:600; color:#34495e;}
.r-divider {height:12px;}

@media(max-width: 640px) {
  .result-layout {flex-direction:column;}
  .result-nav {width:100%; flex-direction:row; flex-wrap:wrap; gap:6px; background: #f8fafc; padding: 8px; border-radius: 8px;}
  .r-tab {flex:1 1 30%; text-align:center; font-size:12px; padding:8px 4px;}
  .r-tab.sub {margin-left:0; border:none; background:#fff; border:1px solid #e1e4e8;}
  .r-divider {display:none;}
}

.chart-info {display:flex; gap:2rem; align-items:center; flex-wrap:wrap; justify-content: center;}
.chart-col {flex:0 0 auto;}
.info-col {flex:1; min-width:220px; background: #f8fafc; padding: 1.5rem; border-radius: 8px; border: 1px solid #e1e4e8;}

.legend-2x2 {display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:16px;}
.leg-item {display:flex; align-items:center; gap:6px; font-size:13px; color:#475569;}
.leg-sq {width:16px; height:16px; border-radius:3px; flex-shrink:0;}
.leg-sq2 {width:12px; height:12px; border-radius:3px; flex-shrink:0;}

.diff-head {font-size:13px; font-weight:600; color:#34495e; margin:1rem 0 8px; border-bottom: 1px solid #cbd5e1; padding-bottom: 4px;}
.diff-2x2 {display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.diff-card {background:#fff; border-radius:6px; padding:10px 12px; border:1px solid #e1e4e8; border-left-width:4px; box-shadow: 0 1px 3px rgba(0,0,0,0.02);}
.diff-lbl {font-size:11px; color:#64748b; margin-bottom:4px; font-weight: 500;}
.diff-val {font-size:15px; font-weight:600; color:#1e293b;}
.diff-sub {font-size:10px; color:#94a3b8; margin-top: 2px;}

.retry-btn {display:inline-flex; align-items:center; justify-content:center; gap:6px; font-size:14px; font-weight:500; color:#475569; cursor:pointer; margin-top:2rem; border:1px solid #cbd5e1; border-radius:6px; padding:10px 20px; background:#fff; transition: all 0.2s;}
.retry-btn:hover {background:#f8fafc; border-color:#94a3b8;}
svg{display:block; margin: 0 auto;}