@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

/* ============================================
   tomo_iezukuri デザインシステム v2.2 準拠
   生成り×焦げ茶×飴色/淡色 #8A7A69/本文16px以上
   19_timeline の骨格を流用
   ============================================ */
:root {
  --ink: #FAF6EF;
  --panel: #FFFFFF;
  --panel-deep: #F1EAE0;
  --paper: #4A4238;
  --faint: #8A7A69;
  --brass: #C9862B;
  --line: rgba(74, 66, 56, 0.12);
  --disabled: #D9D0C3;
  --shadow: 0 2px 10px rgba(74, 66, 56, 0.07);
  --serif: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
  --radius-card: 16px;
  --radius-btn: 14px;
  --radius-chip: 999px;
  --pad-card: 16px;
  --gap: 12px;
  --screen-pad: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--paper);
  background: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}

button,
a { -webkit-tap-highlight-color: transparent; }

.view {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px var(--screen-pad) 40px;
}

.hidden { display: none; }

/* ===== ボタン ===== */
.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--sans);
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--brass);
  color: var(--ink);
  margin-top: 24px;
}

.btn-primary:disabled {
  background: var(--disabled);
  color: var(--faint);
  cursor: not-allowed;
}

.btn-secondary {
  color: var(--brass);
  background: var(--panel);
  border: 2px solid var(--brass);
}

.btn-text {
  min-height: 44px;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  padding: 8px 0;
}

.link-center {
  display: block;
  margin: 20px auto 0;
  text-decoration: underline;
}

button:focus-visible,
a:focus-visible,
input:focus-visible + .choice-marker {
  outline: 3px solid rgba(201, 134, 43, 0.38);
  outline-offset: 3px;
}

/* ===== トップ ===== */
.top-hero { text-align: center; padding: 40px 0 28px; }

.top-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.4;
  margin-bottom: 14px;
}

.top-sub { font-size: 16px; color: var(--faint); }

#view-top > .btn-primary {
  margin-top: 0;
  margin-bottom: 28px;
}

.intro-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: var(--pad-card);
  margin-bottom: var(--gap);
}

.intro-card-single { margin-bottom: 0; }

.intro-text { font-size: 16px; color: var(--paper); }

/* ===== 進捗バー ===== */
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 6px;
}

.progress-labels.small {
  justify-content: flex-end;
  font-size: 13px;
  margin-bottom: 4px;
}

.progress-bar {
  height: 10px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  overflow: hidden;
}

.progress-bar.slim { height: 6px; }

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brass);
  border-radius: var(--radius-chip);
  transition: width 0.25s;
}

/* ===== 診断画面 ===== */
.check-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.check-header-progress { flex: 1; max-width: 200px; }

.question-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px var(--pad-card);
}

.question-number {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brass);
  margin-bottom: 4px;
}

.question-title {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.45;
}

.question-hint {
  color: var(--faint);
  font-size: 14px;
  margin-top: 4px;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 54px;
  padding: 13px 14px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.choice:has(input:checked) {
  background: #FFF8EC;
  border: 2px solid var(--brass);
  padding: 12px 13px;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-marker {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 2px solid var(--faint);
  border-radius: 7px;
  margin-top: 1px;
}

input[type="radio"] + .choice-marker { border-radius: 50%; }

.choice input:checked + .choice-marker {
  background: var(--brass);
  border-color: var(--brass);
}

.choice input:checked + .choice-marker::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-1px) rotate(-45deg);
}

input[type="radio"]:checked + .choice-marker::after {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  transform: none;
}

.choice-label {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
}

.question-actions .btn-primary { margin-top: 16px; }

/* ===== 結果画面 ===== */
.result-summary {
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: center;
  padding: 28px 20px;
  margin: 16px 0 20px;
}

.result-headline {
  color: var(--faint);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.15em;
}

.result-count {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  margin: 8px 0 0;
}

.result-number {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  color: var(--brass);
  line-height: 1.2;
  margin: 0 4px;
}

.result-message {
  font-size: 16px;
  text-align: left;
  margin-top: 12px;
}

.group-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px var(--pad-card);
  margin-bottom: var(--gap);
}

.group-name {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
}

.result-section { margin-top: 18px; }

.result-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 5px;
}

.result-section-text { font-size: 16px; }

.bunrei-text {
  padding: 14px;
  background: var(--panel-deep);
  border-radius: 10px;
}

.copy-button {
  display: block;
  min-height: 44px;
  margin: 10px 0 0 auto;
  padding: 8px 16px;
  border: 1px solid var(--brass);
  border-radius: var(--radius-chip);
  color: var(--brass);
  background: var(--panel);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== 次の一歩 ===== */
.next-step {
  margin-top: 28px;
  padding: var(--pad-card);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.next-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brass);
  margin-bottom: 10px;
}

.next-step-links {
  display: grid;
  gap: 10px;
}

/* ===== 共通フッター ===== */
.tool-footer {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px var(--screen-pad) 40px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.tool-footer .brand {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
}

.tool-footer .links {
  color: var(--faint);
  font-size: 16px;
  margin-top: 6px;
}

.tool-footer .links span { margin: 0 4px; }

.tool-footer .links a {
  color: var(--brass);
  text-decoration: none;
  margin: 0 4px;
}

@media (max-width: 374px) {
  :root { --screen-pad: 16px; }
  .top-title { font-size: 29px; }
  .top-hero { padding-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}
