/* 模擬顧客パネル
   色は「購買意向の5段階」にだけ意味を持たせる。それ以外は墨と紙の2色で抑える。 */
:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --ink: #1b2a3a;
  --ink-2: #4a5867;
  --ink-3: #5f6b78;
  --line: #d8dee4;
  --line-2: #e8ecf0;
  --accent: #1b2a3a; /* 操作の色は墨。青は購買意向の「買う」専用 */
  --accent-ink: #ffffff;
  --l1: #b4413c;
  --l2: #e39a85;
  --l3: #c4c1ba;
  --l4: #7aaed0;
  --l5: #1f5f99;
  --warn-bg: #fff4e5;
  --warn-ink: #8a4b00;
  --err-ink: #a3302b;
  --radius: 6px;
  --font: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --figure: "Barlow Semi Condensed", "BIZ UDPGothic", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.35; margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.fig { font-family: var(--figure); font-feature-settings: "tnum"; }

/* ---------------------------------------------------------------- ヘッダー */
.top {
  background: var(--ink);
  color: #fff;
}
.top-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand-mark { display: flex; gap: 2px; align-items: flex-end; height: 18px; }
.brand-mark i { width: 4px; display: block; border-radius: 1px; }
.top nav { display: flex; gap: 18px; flex: 1; }
.top nav a { color: #c9d3de; text-decoration: none; font-size: 14px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: #fff; }
.who { font-size: 13px; color: #c9d3de; display: flex; gap: 12px; align-items: center; }
.who button { background: none; border: 0; color: #c9d3de; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }

/* ---------------------------------------------------------------- 部品 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  padding: 9px 18px;
  font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { background: #c9d0d7; border-color: #c9d0d7; color: var(--ink-2); cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: transparent; color: var(--ink-2); border-color: var(--line); font-weight: 400; }
.btn.danger { background: #fff; color: var(--ink); border-color: var(--ink); font-weight: 400; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }
.error-text { color: var(--ink); font-weight: 700; }

label.field { display: block; margin-bottom: 18px; }
label.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
label.field > small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 4px; }
input[type="text"], input[type="number"], input[type="email"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.7; }

/* ---------------------------------------------------------------- 5 段階の帯 */
.band { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--line-2); }
.band > span { display: block; height: 100%; }
.band.tall { height: 26px; }
.band.tall > span { position: relative; }
.band.tall > span b {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--figure); font-size: 13px; font-weight: 600; color: #fff;
}
.band.tall > span.l3 b, .band.tall > span.l2 b, .band.tall > span.l4 b { color: var(--ink); }
.l1 { background: var(--l1); } .l2 { background: var(--l2); } .l3 { background: var(--l3); }
.l4 { background: var(--l4); } .l5 { background: var(--l5); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------------------------------------------------------------- 一覧 */
.survey-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.survey-row {
  background: var(--surface); padding: 16px 20px; display: grid;
  grid-template-columns: 1fr 220px 120px; gap: 20px; align-items: center;
  text-decoration: none; color: inherit;
}
.survey-row:hover { background: #f8fafc; }
.survey-row .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.status { font-size: 12px; font-weight: 700; }
.status.running { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.status.done { color: var(--ink-2); }
.status.canceled { color: var(--ink-3); }
.empty { text-align: left; padding: 48px 24px; }
.empty p { margin: 8px 0 20px; }

/* ---------------------------------------------------------------- 作成フォーム */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.concept { border-top: 1px solid var(--line-2); padding-top: 20px; margin-top: 20px; }
.concept:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.concept-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.concept-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; }
.axes { display: grid; gap: 16px; }
.axis h3 { font-size: 13px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; font-size: 13px; cursor: pointer; background: #fff; color: var(--ink-2);
}
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.quote-box { position: sticky; top: 20px; }
.quote-box dl { margin: 12px 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.quote-box dt { color: var(--ink-2); }
.quote-box dd { margin: 0; text-align: right; font-family: var(--figure); font-size: 17px; font-weight: 600; }
.quote-box .problems { margin: 0 0 12px; padding: 10px 12px 10px 28px; background: var(--line-2); border-radius: var(--radius); color: var(--ink); font-size: 13px; }
.quote-box .problems::before { content: "開始する前に"; display: block; font-weight: 700; margin-left: -16px; }
.fake-cost { font-weight: 700; font-size: 16px; margin-top: 10px; }

/* ---------------------------------------------------------------- 進捗 */
.progress { margin: 8px 0 28px; }
.progress[hidden] { display: none; }
.progress-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; gap: 12px; }
.progress-track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.progress-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------------------------------------------------------------- 結果: 物差し（主役） */
.ruler-wrap { padding: 28px 28px 20px; }
.ruler { position: relative; margin: 8px 8px 0; }
.ruler-scale { position: relative; height: 34px; border-bottom: 2px solid var(--ink); }
.ruler-scale .tick { position: absolute; bottom: -2px; width: 2px; height: 12px; background: var(--ink); transform: translateX(-1px); }
.ruler-scale .tick.minor { height: 6px; width: 1px; background: var(--ink-3); }
.ruler-scale .tick-label { position: absolute; top: 40px; transform: translateX(-50%); text-align: center; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.ruler-scale .tick-label.first { transform: translateX(-8px); text-align: left; }
.ruler-scale .tick-label.last { transform: translateX(calc(-100% + 8px)); text-align: right; }
.ruler-scale .tick-label b { display: block; font-family: var(--figure); font-size: 16px; color: var(--ink); }
.ruler-marks { position: relative; margin-top: 70px; }
.mark-row { position: relative; height: 56px; }
.mark-row .ci {
  position: absolute; top: 17px; height: 12px; box-sizing: border-box;
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat;
}
.mark-row .dot {
  position: absolute; top: 11px; width: 24px; height: 24px; border-radius: 50%; transform: translateX(-12px);
  background: var(--ink); color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ink);
  font-family: var(--figure); font-size: 13px; font-weight: 600; display: grid; place-items: center; line-height: 1;
}
.mark-row .tag { position: absolute; left: calc(var(--x) + max(var(--w), 14px)); top: 4px; font-size: 13px; white-space: nowrap; transform: translateX(10px); line-height: 1.3; }
.mark-row .tag .range { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.mark-row .tag b { font-family: var(--figure); font-size: 22px; font-weight: 600; margin-right: 8px; }
.mark-row .tag.left { left: calc(var(--x) - max(var(--w), 14px)); transform: translateX(calc(-100% - 10px)); text-align: right; }
.letter {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center;
  font-family: var(--figure); font-weight: 600; font-size: 14px; flex: none; align-self: center;
}

.mark-row .tag-sp { display: none; }
.conclusion .sub { display: block; font-weight: 400; font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.conclusion { font-size: 18px; font-weight: 700; margin: 8px 0 4px; max-width: 46em; }
.disclaimer { font-size: 12px; color: var(--ink-3); margin-top: 18px; }

/* ---------------------------------------------------------------- 結果: コンセプト別 */
.result-section { margin-top: 40px; }
.result-section > h2 { margin-bottom: 14px; }
.concept-result { border-top: 3px solid var(--ink); padding-top: 18px; margin-top: 28px; }
.concept-result-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.concept-result-head .swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
details.shown { margin: 0 0 16px; font-size: 14px; }
details.shown summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
details.shown p { background: #f8fafc; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px; margin-top: 8px; line-height: 1.7; white-space: pre-wrap; max-width: 46em; }
.context-note { font-size: 13px; color: var(--ink-2); margin: -12px 0 20px; }
.kpis { display: flex; gap: 32px; flex-wrap: wrap; margin: 4px 0 16px; }
.kpi .v { font-family: var(--figure); font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi .k { font-size: 12px; color: var(--ink-2); }
.split { font-size: 12px; color: var(--ink-2); margin-top: 8px; }

.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px 32px; margin-top: 22px; }
.seg h3 { font-size: 13px; margin-bottom: 8px; }
.seg-row { display: grid; grid-template-columns: 150px 1fr 82px; gap: 10px; align-items: center; font-size: 13px; min-height: 26px; }
.seg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-row .bar { position: relative; height: 12px; background: var(--line-2); border-radius: 2px; }
.seg-row .bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3); }
.seg-row .bar span { position: absolute; top: 0; bottom: 0; }
.seg-row .bar span { background: var(--ink); }
.seg-row .n { color: var(--ink-3); font-size: 11px; margin-left: 4px; }
.seg-row .val { font-family: var(--figure); font-weight: 600; text-align: right; white-space: nowrap; }
.seg-row .val .d { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-left: 6px; }

.voices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.voices h3 { font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.voices h3 i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.voice { font-size: 14px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.voice .who { font-size: 12px; color: var(--ink-3); margin-top: 4px; display: block; }
.voice .who b { font-family: var(--figure); color: var(--ink-2); margin-right: 6px; }

.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pair { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pair h3 { margin-bottom: 8px; }
.pair dl { margin: 0 0 8px; }
.pair dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.pair dt { color: var(--ink-2); }
.pair dd { margin: 0 0 0 auto; text-align: right; }
.pair dl > div { flex-wrap: wrap; }
.pair dd b { font-size: 18px; }
.cross-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cross-head select { width: auto; margin-left: 6px; padding: 5px 10px; }
table.cross { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
table.cross th, table.cross td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
table.cross th:first-child, table.cross td:first-child { text-align: left; }
table.cross th { font-size: 12px; color: var(--ink-2); }
table.cross td.best { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
table.cross td.lead { text-align: left; font-size: 13px; white-space: normal; min-width: 9em; line-height: 1.5; }
table.cross .verdict { font-size: 15px; }
table.cross tr.few td { color: var(--ink-3); }
.letter.sm { width: 18px; height: 18px; font-size: 11px; margin-right: 6px; vertical-align: -3px; }
.legend b { color: var(--ink); }
table.pairs { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.pairs th, table.pairs td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); text-align: left; }
table.pairs th { font-size: 12px; color: var(--ink-2); font-weight: 700; }
table.pairs td.num { font-family: var(--figure); font-size: 16px; font-weight: 600; }

.table-scroll { overflow-x: auto; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- ログイン */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { max-width: 420px; width: 100%; }
.login-card h1 { font-size: 24px; margin: 18px 0 8px; }
.login-card .band { margin: 0 0 6px; }
.google-btn {
  margin-top: 28px; display: inline-flex; gap: 10px; align-items: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 20px; border-radius: var(--radius); text-decoration: none; font-weight: 700;
}
.google-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- 解説 */
.prose { max-width: 680px; }
.prose h2 { margin: 36px 0 10px; }
.prose p, .prose li { margin-bottom: 10px; }
.prose ol { padding-left: 1.4em; }

/* ---------------------------------------------------------------- メンバー */
table.members { width: 100%; border-collapse: collapse; font-size: 14px; }
table.members td, table.members th { padding: 10px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .quote-box { position: static; }
  .voices { grid-template-columns: 1fr; }
  .survey-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
  /* スマホは 1 区分 1 枠: 上段に区分と各案の平均、下段に全幅で比較の判定 */
  table.cross, table.cross thead, table.cross tbody { display: block; }
  table.cross thead tr, table.cross tbody tr { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  table.cross th, table.cross td { border: 0; padding: 6px 8px; font-size: 13px; flex: 1 1 0; }
  table.cross th:nth-child(2), table.cross td:nth-child(2), table.cross th.lead-h { display: none; }
  table.cross td.lead { flex-basis: 100%; padding-top: 0; }
  .seg-row { grid-template-columns: 104px 1fr 72px; gap: 8px; padding: 3px 0; }
  .seg-row .seg-name { white-space: normal; line-height: 1.3; }
  .seg-row .seg-name .n { display: block; margin-left: 0; }
  .seg-row .val .d { display: block; margin-left: 0; }
  /* スマホでは物差しに丸と区間だけを置き、数値と案名は下の一覧に分ける */
  /* スマホは 1 案 1 段: 上に案名と数値、下に同じ軸上の丸と区間 */
  .mark-row { height: 70px; margin-bottom: 20px; }
  .mark-row .tag { display: none; }
  .mark-row .tag-sp { display: block; position: absolute; left: 0; top: 0; font-size: 14px; white-space: nowrap; }
  .mark-row .tag-sp b { font-size: 17px; margin: 0 2px; }
  /* 丸の真下に区間を出す（丸に隠れないよう上下にずらす） */
  .mark-row .dot { width: 20px; height: 20px; transform: translateX(-10px); top: 30px; font-size: 11px; border-width: 1px; }
  .mark-row .ci { top: 54px; height: 12px; }
  .ruler-marks { margin-top: 56px; }
  main { padding: 20px 16px 60px; }
  .top-inner { padding: 10px 16px; gap: 6px 14px; height: auto; flex-wrap: wrap; }
  .top nav { gap: 14px; order: 3; flex-basis: 100%; overflow-x: auto; white-space: nowrap; }
  .ruler-scale .tick-label { font-size: 10px; }
  .who span { display: none; }
  .concept-row { grid-template-columns: 1fr; }
  .ruler-wrap { padding: 20px 14px; }
  .mark-row .tag { font-size: 12px; }
  .mark-row .tag b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}
