/* 参照: 画面設計 §2.2・§2.4・§5 / ブランド基礎 v0.5 :root（トークン値は改変なし流用） */

:root {
  --cream: #fafcfd;
  --cream-deep: #e7ebec;
  --panel: #ffffff;
  --ink: #222a2e;
  --ink-soft: #5c666b;
  --teal: #2e6e78;
  --teal-deep: #234f57;
  --teal-tint: #d6ecee;
  --apricot: #f59e5c;
  --apricot-deep: #e07b47;
  --radius: 18px;
  --shadow: 0 10px 34px rgba(46, 110, 120, 0.1);
  /* LP 源は 1080px（ブランド基礎 v0.5）／プロトタイプは 640px に縮小（画面設計 §2.2・V8） */
  --maxw: 640px;
  --display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", system-ui,
    sans-serif;
  --body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui,
    sans-serif;
}

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1 {
  color: var(--teal-deep);
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.3;
}

.proto-shell {
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 32px 24px 48px;
}

.card {
  background: var(--panel);
  border: 1px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card + .card,
.proto-shell > h1 + p,
.proto-shell > p + .card {
  margin-top: 20px;
}

.btn {
  align-items: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  font-family: var(--body);
  font-size: 17px;
  font-weight: 500;
  justify-content: center;
  line-height: 1.4;
  min-height: 44px;
  padding: 10px 20px;
  text-align: center;
  width: 100%;
}

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

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

.btn-primary:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}

.preview-note {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 16px;
}

.screen + .screen {
  margin-top: 0;
}

.question-card .question-body,
.consent-body {
  margin-bottom: 20px;
}

.question-body strong,
.btn-choice strong {
  font-weight: 700;
}

.footnote {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 16px;
}

.footnote-small {
  font-size: 14px;
  margin-bottom: 0;
  margin-top: 16px;
}

.link-placeholder {
  color: var(--teal);
}

.onboard-intro {
  margin-bottom: 16px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-choice {
  background: var(--panel);
  border: 2px solid var(--teal-tint);
  color: var(--ink);
  text-align: left;
}

.btn-choice:hover:not(:disabled) {
  background: var(--teal-tint);
  border-color: var(--teal);
}

.btn-choice:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-secondary {
  background: var(--cream-deep);
  color: var(--ink);
}

.btn-secondary:hover {
  background: #d8ddde;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.consent-heading {
  color: var(--teal-deep);
  font-family: var(--display);
  font-size: clamp(20px, 3.5vw, 24px);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}

.consent-check {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.consent-check input {
  flex-shrink: 0;
  height: 22px;
  margin-top: 4px;
  width: 22px;
}

.optional-input {
  display: block;
  margin-bottom: 16px;
}

.optional-label {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.text-input {
  border: 2px solid var(--teal-tint);
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 44px;
  padding: 10px 14px;
  width: 100%;
}

.text-input:focus {
  border-color: var(--teal);
  outline: none;
}

.safety-footer {
  color: var(--ink-soft);
  font-size: 15px;
  margin-top: 20px;
}

.procedure-card .question-body,
.resolve-card .question-body {
  margin-bottom: 20px;
}

.confidence-line {
  margin-bottom: 20px;
}

.node-note {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 16px;
}

.exit-node-body,
.exit-template-body {
  margin-bottom: 16px;
}

.section-label {
  color: var(--teal-deep);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 12px;
}

.outlet-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.outlet-card {
  background: var(--cream);
  border-radius: calc(var(--radius) - 4px);
  padding: 16px;
}

.outlet-label {
  font-weight: 500;
  margin-bottom: 8px;
}

.outlet-note,
.outlet-tel {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 8px;
}

.outlet-link {
  margin-top: 8px;
  text-decoration: none;
}

.placeholder-card .placeholder-heading {
  color: var(--teal-deep);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.placeholder-card p {
  margin-bottom: 20px;
}

/* S5 AssistChat — 画面設計 §4.6 */
.assist-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assist-back {
  align-self: flex-start;
  min-height: 44px;
  padding: 8px 0;
}

.assist-heading {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.assist-history {
  background: var(--cream-deep);
  border-radius: 8px;
  min-height: 80px;
  padding: 12px;
}

.assist-empty {
  color: var(--ink-soft);
  margin: 0;
}

.assist-msg {
  margin-bottom: 12px;
}

.assist-msg-user p {
  background: var(--teal-tint);
  border-radius: 8px;
  margin: 0;
  padding: 10px 12px;
}

.assist-msg-assistant p {
  margin: 0;
}

.assist-input {
  width: 100%;
}

.assist-error,
.consent-error {
  color: var(--apricot-deep);
  margin: 8px 0 0;
}

.assist-return-hint {
  color: var(--ink-soft);
  margin: 0;
}

.secret-rejected {
  border-left: 4px solid var(--apricot-deep);
  padding: 12px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--teal-deep);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* 参照: 画面設計 §5 SafetyOverlay — S6 全文差し替え */
.safety-overlay {
  border-left: 4px solid var(--apricot-deep);
}

.safety-core p,
.safety-meta,
.safety-handoff,
.safety-o4 {
  margin-bottom: 16px;
}

.safety-bullet-list {
  margin: 0 0 16px 1.2em;
  padding: 0;
}

.safety-bullet-list li {
  margin-bottom: 8px;
}

.tree-screen-wrap {
  position: relative;
}

.tree-screen-wrap--dimmed {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

/* 参照: 画面設計 §7.3 — S7 インラインオーバーレイ */
.consistency-backdrop {
  background: rgba(34, 42, 46, 0.45);
  inset: 0;
  position: fixed;
  z-index: 100;
}

.consistency-overlay {
  border-left: 4px solid var(--teal);
  left: 50%;
  max-width: min(var(--maxw), calc(100vw - 32px));
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  z-index: 101;
}

.consistency-prefix {
  color: var(--teal-deep);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.consistency-hint {
  margin-bottom: 20px;
}

/* 参照: 画面設計 §4.9–4.11 — 登録・アンケート・任意 FB */
.register-gate-card .question-body,
.survey-card .survey-intro {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-weight: 500;
  margin-bottom: 12px;
}

.register-form .field-label {
  margin-top: 4px;
}

.register-form .text-input {
  margin-bottom: 16px;
}

.register-consent {
  margin-bottom: 20px;
}

.honeypot {
  height: 0;
  left: -9999px;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.survey-fieldset {
  border: none;
  margin: 0 0 20px;
  padding: 0;
}

.survey-fieldset .field-label,
.survey-fieldset legend {
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
}

.survey-option {
  cursor: pointer;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 44px;
  align-items: center;
}

.survey-option input {
  flex-shrink: 0;
  height: 22px;
  width: 22px;
}

.text-area {
  border: 2px solid var(--teal-tint);
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 8px;
  padding: 10px 14px;
  resize: vertical;
  width: 100%;
}

.text-area:focus {
  border-color: var(--teal);
  outline: none;
}

.fb-offer-secondary {
  border-top: 1px solid var(--cream-deep);
  margin-bottom: 16px;
  padding-top: 16px;
}

.fb-offer-secondary summary {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 15px;
  list-style: none;
  min-height: 44px;
  padding: 8px 0;
}

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

.fb-offer-body {
  margin-top: 12px;
}

.fb-offer-thanks {
  color: var(--teal-deep);
  margin-bottom: 12px;
}

.feedback-card .field-label {
  margin-bottom: 12px;
}
