/* ============================================
   みんなの統計 共通スタイル
   コンセプト: 「測定と記録」の道具箱
   方眼紙のグリッドを背景に、数値は等幅フォントで
   計測器の数字のように見せる
   配色: インクグリーン(最終決定)
   ============================================ */

:root {
  --paper: #f5f6f2;
  --grid-line: #dfe3dc;
  --ink: #24312b;
  --ink-soft: #5b6b62;
  --accent: #1b7f6f;      /* インク・グリーン */
  --accent-soft: #d8ece7;
  --data-amber: #c98a2b;  /* 数値の強調色 */
  --border: #c7cec6;
  --danger: #b3452f;
  --success: #1b7f6f;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

/* 画像が未設定の質問に表示するプレースホルダー */
.details-summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
  user-select: none;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 7px 14px;
  list-style: none;
}

.details-summary::-webkit-details-marker {
  display: none;
}

.details-summary::after {
  content: "\25BC";
  font-size: 8px;
  transition: transform 0.15s ease;
}

details[open] > .details-summary::after {
  transform: rotate(180deg);
}

.details-summary:hover {
  background: var(--accent-soft);
}

.no-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px dashed var(--border);
  border-radius: 5px;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.6;
  padding: 40px 20px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
}

/* ヘッダー: 計測器のラベルのような見出し */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 28px;
}

.site-header .brand {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-header .user {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--ink-soft);
}

.site-header .user a {
  color: var(--accent);
  margin-left: 12px;
}

/* ヘッダー右側: ユーザー名・ログアウト・メニューアイコン */
.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;

}

.user-bar .user-name {
  color: var(--ink-soft);
}

.user-bar a {
  color: var(--accent);
}

.nav-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* 背景の暗いオーバーレイ */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 90;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* 右からスライドインするメニューパネル */
.nav-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 280px;
  max-width: 85vw;
  background: var(--card-bg);
  box-shadow: -6px 0 24px rgba(20, 26, 23, 0.2);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 91;
  padding: 20px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-menu.open {
  transform: translateX(0);
}

.nav-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 4px;
}

.nav-close:hover {
  color: var(--accent);
}

.nav-section-label {
  margin: 16px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 14px;
}

.nav-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-menu a.is-current {
  background: var(--ink);
  color: #fff;
}

.nav-menu a.is-current .nav-icon {
  color: var(--data-amber);
}

h1 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin: 36px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
img.logo {
    max-height: 60px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(36, 49, 43, 0.06), 0 1px 1px rgba(36, 49, 43, 0.04);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

/* 質問結果カードなどを横に並べてコンパクトに表示するためのグリッド */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card-grid .card {
  margin-bottom: 0;
  padding: 18px;
}

.card-grid .card:hover {
  box-shadow: 0 8px 20px rgba(36, 49, 43, 0.14);
  transform: translateY(-3px);
  border-color: var(--accent);
}

/* クリックできない、説明用の静的カードを並べるためのグリッド(浮き上がりホバー無し) */
.card-grid-static {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card-grid-static .card {
  margin-bottom: 0;
  padding: 18px;
}

/* フォーム */
form .field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

/* 質問文そのものの見出し(小さいフォームラベルとは別格で、しっかり目立たせる) */
.question-heading {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 16px;
}

.question-heading .badge-new {
  vertical-align: middle;
  margin-left: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* iOS Safariなどで、日付入力欄が内部コンテンツの都合で
   コンテナ幅からはみ出してしまうのを防ぐ */
input[type="date"] {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.password-wrapper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--paper);
  overflow: hidden;
}

.password-wrapper input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.password-wrapper input:focus {
  outline: none;
}

.password-wrapper:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.password-toggle {
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: none;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 6px 12px;
  min-width: 64px;
  text-align: center;
  transition: background-color 0.15s ease;
}

.password-toggle:hover {
  background: var(--accent-soft);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

.status-badge.answered {
  background: var(--accent-soft);
  color: var(--success);
}

.status-badge.unanswered {
  background: #fbeae4;
  color: var(--danger);
}

.badge-new {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  background: var(--data-amber);
  color: #fff;
}

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
}

button,
.btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover,
.btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

button:active,
.btn:active {
  transform: translateY(0);
}

/* シェアボタン: それぞれのサービスの雰囲気に合わせた色 */
.btn-x {
  background: #000;
}

.btn-x:hover {
  background: #262626;
}

.btn-line {
  background: #06c755;
}

.btn-line:hover {
  background: #05a648;
}

.btn-outline {
  background: none;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink-soft);
}

/* 結果の割合を示す、円グラフ風のバッジ */
.result-ring-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 18px;
}

.result-ring-wrap svg {
  transform: rotate(-90deg);
}

.result-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.result-ring-fill {
  fill: none;
  stroke: var(--data-amber);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: var(--dasharray);
  stroke-dashoffset: var(--dashoffset);
  transition: stroke-dashoffset 0.6s ease;
}

.result-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-ring-label .num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 34px;
  color: var(--data-amber);
  line-height: 1;
}

.result-ring-label .unit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* 結果カードの上に載せる、アクセントの帯 */
.result-card {
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--data-amber));
}

/* 入力のヒント(ポジティブな案内。目立たせて読んでもらう) */
.tip-box {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin: 10px 0 12px;
}

.tip-box .tip-label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

/* 注意事項(控えめに、しかしヒントとは違う見た目で) */
.notice-text {
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 12px;
}

/* メッセージ */
.msg {
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 20px;
  border-left: 4px solid;
}

.msg.error {
  background: #fbeae4;
  border-color: var(--danger);
  color: var(--danger);
}

.msg.success {
  background: var(--accent-soft);
  border-color: var(--success);
  color: var(--success);
}

/* 統計サマリー: LCD表示のような数字ブロック */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-box {
  background: linear-gradient(135deg, var(--ink) 0%, #1a251f 100%);
  color: #fff;
  border-radius: 4px;
  padding: 14px 16px;
}

.stat-box .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b7c4bd;
  margin-bottom: 4px;
}

.stat-box .value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 22px;
  color: var(--data-amber);
}

/* 都道府県ランキングのバー表示 */
.rank-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 3px;
  font-size: 13px;
}

.rank-item.is-mine {
  background: var(--accent-soft);
  font-weight: 600;
}

.rank-number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--ink-soft);
  width: 18px;
  flex-shrink: 0;
  text-align: right;
}

.rank-pref {
  width: 64px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-bar-track {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
}

.rank-bar-fill {
  display: block;
  background: linear-gradient(90deg, var(--accent), #24a390);
  height: 100%;
  border-radius: 3px 0 0 3px;
  width: var(--pct, 0%);
}

.rank-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--data-amber);
  width: 54px;
  flex-shrink: 0;
  text-align: right;
}

/* テーブル: 台帳(ledger)のような罫線 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th,
table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

tr.row-answered,
.card.row-answered {
  background: var(--accent-soft);
}

tr.row-unanswered,
.card.row-unanswered {
  background: #fbeae4;
}

table th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
}

table td.numeric {
  font-family: "IBM Plex Mono", monospace;
  color: var(--data-amber);
  text-align: right;
}

a {
  color: var(--accent);
}

.helper-text {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 18px;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  min-width: 640px;
}

canvas {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============ レスポンシブ対応 ============ */
@media (max-width: 600px) {
  body {
    padding: 20px 12px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  h1 {
    font-size: 22px;
  }

  .card {
    padding: 16px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  table th,
  table td {
    padding: 6px 8px;
    font-size: 13px;
  }
  .user-bar{
    justify-content: space-between;
    width: 100%;
  }
}

/* 「上に戻る」ボタン(スクロールすると右下に表示される) */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(20, 26, 23, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 80;
  display:flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
}

/* サイト共通フッター */
.site-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* アクセント背景のCTAカード(登録誘導などで使い回す) */
.cta-card {
  text-align: center;
  background: var(--accent-soft);
  border-color: var(--accent);
  padding: 32px 24px;
}

.cta-card.cta-card-lg {
  padding: 40px 24px;
}

/* 自由記述: 他の回答者の声を、ふきだし風のチップで並べる */
.text-answer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 14px 0;
}

.text-answer-chip {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 18px 10px 30px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(36, 49, 43, 0.05);
}

.text-answer-chip::before {
  content: "\201C";
  position: absolute;
  left: 12px;
  top: 6px;
  font-family: Georgia, serif;
  font-size: 20px;
  color: var(--accent);
  line-height: 1;
}

.text-answer-chip:nth-child(3n+2) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.text-answer-chip:nth-child(3n+2)::before {
  color: var(--accent);
}

.text-answer-chip:nth-child(4n+3) {
  border-color: var(--data-amber);
}

.text-answer-chip:nth-child(4n+3)::before {
  color: var(--data-amber);
}

/* 質問一覧: テーブルではなく、1件ずつカードで積み重ねる表示(横スクロール無し) */
.question-list-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-list-card {
  position: relative;
  margin-bottom: 0;
  padding: 14px 44px 14px 14px;
}

.question-list-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.question-list-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.question-list-card-main {
  flex: 1 1 160px;
  min-width: 0;
}

.question-list-text {
  margin: 0;
  font-size: 15px;
  overflow-wrap: break-word;
}

.question-list-favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 2px;
  line-height: 1;
  color: var(--border);
}

.question-list-favorite.is-active {
  color: var(--data-amber);
}

.question-list-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* お気に入りボタンを押したときの、弾むアニメーション */
@keyframes favoritePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

.favorite-pop {
  animation: favoritePop 0.35s ease;
}

/* 質問一覧: 並び順セレクタ(ラベルと横並び) */
.sort-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.sort-field label {
  margin-bottom: 0;
  white-space: nowrap;
}

.sort-field select {
  width: auto;
  min-width: 200px;
}

/* お気に入りフォーム自体は、レイアウトに影響させず中身だけ配置したい */
.favorite-form {
  display: contents;
}

/* お気に入りアイコン内、画像が無い場合のプレースホルダー文字サイズ */
.question-list-thumb-empty {
  font-size: 7px;
  line-height: 1.2;
  text-align: center;
  flex-direction: column;
}

/* 質問カード内、回答状況の行 */
.question-list-status {
  margin: 6px 0 0;
}

/* 質問カードの操作ボタン(回答する・編集する) */
.question-list-action-btn {
  display: inline-block;
  font-size: 13px;
  padding: 8px 14px;
}

/* 質問カードの「マイページで見る」リンク */
.question-list-link-small {
  font-size: 13px;
}

/* マイページ: 都道府県を選んで内訳を見るプルダウン */
.pref-breakdown-picker {
  margin: 14px 0;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.pref-breakdown-picker label {
  display: block;
  margin-bottom: 6px;
}

.pref-breakdown-select {
  max-width: 220px;
}

.pref-breakdown-result {
  margin-top: 10px;
}

/* ============================================
   共通ユーティリティ(インラインCSS除去のため)
   ============================================ */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.m-0 { margin: 0; }
.mt-12 { margin-top: 12px; }
.mt-neg14-sm { margin-top: -14px; font-size: 12px; }
.d-ib { display: inline-block; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-contents { display: contents; }
.w-auto { width: auto; }
.ml-8 { margin-left: 8px; }
.list-plain { margin: 0; padding-left: 20px; }
.text-center-muted { justify-content: center; color: var(--ink-soft); }

/* ボタンのバリエーション(サイズ違い) */
.btn-lg { display: inline-block; font-size: 16px; padding: 14px 32px; }
.btn-sm { display: inline-block; font-size: 12px; padding: 6px 12px; margin-top: 8px; }

/* 動的な幅は、CSS変数経由で受け取る */
.dyn-width { width: var(--w, 0%); }

/* 質問カードの結果画面共通 */
.result-center { text-align: center; padding: 40px 20px; }
.result-title-lg { margin: 0 0 6px; font-size: 18px; }
.result-sub { margin: 0 0 18px; }

/* 質問画像のプレビュー(回答結果画面) */
.answer-image-preview { max-width: 100%; max-height: 240px; border-radius: 5px; margin-bottom: 14px; display: block; }

/* テキストエリア(自由記述の回答欄) */
.textarea-plain { width: 100%; padding: 10px 12px; font-family: inherit; font-size: 15px; border: 1px solid var(--border); border-radius: 3px; background: var(--paper); color: var(--ink); }

/* サムネイル画像(48px / 96px の2サイズ) */
.thumb-48 { width: 48px; height: 48px; object-fit: cover; border-radius: 3px; }
.thumb-48-empty { width: 48px; height: 48px; font-size: 8px; line-height: 1.2; text-align: center; flex-direction: column; }
.thumb-96 { width: 96px; height: 96px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.thumb-96-empty { width: 96px; height: 96px; font-size: 10px; flex-shrink: 0; }

/* NO IMAGEプレースホルダー(高さ違い3種) */
.placeholder-h100 { width: 100%; height: 100px; font-size: 12px; margin-bottom: 10px; }
.placeholder-h120 { width: 100%; height: 120px; font-size: 12px; margin-bottom: 14px; }
.placeholder-h140 { width: 100%; height: 140px; font-size: 13px; margin-bottom: 14px; }
.placeholder-h160 { width: 100%; height: 160px; font-size: 13px; margin-bottom: 14px; }

/* 円アイコン(芽マークなど) */
.icon-circle { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 26px; }

/* チェックボックスなど、幅を内容に合わせたいinput */
.input-auto { width: auto; }
.input-auto-mt3 { width: auto; margin-top: 3px; }

/* ラベル横に要素を並べる(チェックボックスなど) */
.label-flex { display: flex; align-items: flex-start; gap: 8px; }
.label-flex-center { display: flex; align-items: center; gap: 8px; }

/* デバッグ・簡易ページ用 */
.debug-page { font-family: sans-serif; padding: 40px; }
.debug-error { color: red; font-weight: bold; }
.debug-console { background: #111; color: #0f0; padding: 16px; white-space: pre-wrap; font-size: 13px; }

/* 第2弾で追加したユーティリティ */
.ws-pre-wrap { white-space: pre-wrap; }
.ws-nowrap { white-space: nowrap; }
.valign-mid { vertical-align: middle; }
.hero-center {
  text-align: center;
  padding: 52px 24px 48px;
  position: relative;
  overflow: hidden;
}

.hero-center::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--data-amber));
}
.text-center { text-align: center; }
.pad-14-18 { padding: 14px 18px; }
.preview-img-200 { max-width: 200px; border-radius: 3px; border: 1px solid var(--border); display: block; }
.answer-image-preview-lg { max-width: 100%; max-height: 280px; border-radius: 5px; margin-bottom: 14px; display: block; }
.answer-image-preview-sm { max-width: 100%; max-height: 220px; border-radius: 5px; margin-bottom: 14px; display: block; }
.answer-image-preview-xs { max-width: 100%; max-height: 200px; object-fit: cover; border-radius: 5px; margin-bottom: 10px; }
.result-title-md { margin: 0 0 8px; font-size: 17px; }
.mb-8 { margin: 0 0 8px; }
.mb-6 { margin: 0 0 6px; }
.mb-4 { margin: 0 0 4px; }
.cta-title { margin: 0 0 16px; font-size: 18px; }
.mt-6 { margin-top: 6px; }
.mt-20 { margin-top: 20px; }
.mt-16 { margin-top: 16px; }
.mb-8-only { margin-bottom: 8px; }
.hero-heading {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 18px;
}

.hero-heading-accent {
  color: var(--accent);
}

.hero-eyebrow {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 14px;
  border-radius: 20px;
  margin: 0 0 20px;
}

/* dashboard.php専用 */
.card-highlighted { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-form-flex { display: flex; gap: 8px; flex-wrap: wrap; }
.search-input-flex { flex: 1; min-width: 180px; }
.card-top-flex { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.share-btn-sm { display: inline-block; margin-top: 14px; font-size: 12px; padding: 8px 14px; }
.pagination-flex { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-items: center; }

/* share.php専用 */
.mono-result-value { font-family: 'IBM Plex Mono', monospace; font-size: 20px; }
.mb-20 { margin: 4px 0 20px; }
.mb-24 { margin: 4px 0 24px; }
.quoted-answer-text { font-size: 20px; margin: 12px 0; line-height: 1.6; }

/* 管理画面: リンク風ボタン(削除・編集などの軽い操作) */
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
  font-size: inherit;
}
.link-btn-accent { color: var(--accent); }
.link-btn-danger { color: var(--danger); }
.ml-10 { margin-left: 10px; }
.ml-12 { margin-left: 12px; }
.mt-8-only { margin-top: 8px; }
.btn-sm-noicon { display: inline-block; font-size: 12px; padding: 6px 12px; }
.checkbox-inline-flex { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }

/* スパム対策のハニーポット欄(画面外に隠す) */
.honeypot-hidden { position: absolute; left: -9999px; }

/* ヘッダーのロゴリンク */
.brand-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* index.php専用 */
.hero-subtext { color: var(--ink-soft); max-width: 480px; margin: 0 auto 28px; }
.hero-badges { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; font-size: 13px; color: var(--ink-soft); }

/* profile.php専用(退会エリア) */
.card-danger-border { border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); }

/* question.php専用 */
.card-accent-bg { background: var(--accent-soft); border-color: var(--accent); }
.card-bg-solid { background: var(--card-bg); }
.mono-value-lg { font-family: 'IBM Plex Mono', monospace; font-size: 20px; }

/* 表示・非表示切り替え(JSでクラスの付け外しをして制御する) */
.d-none { display: none; }

/* 回答履歴: 横スクロール不要の、質問と回答を並べる一覧 */
.qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qa-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.qa-row:last-child {
  border-bottom: none;
}

.qa-question {
  flex: 1 1 220px;
  min-width: 0;
}

.qa-answer {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
