/*
 * キクバ Web MVP — 共通スタイル（S0）
 * トーン: T1 夜型（濃紺 #101826 ／ 淡いラベンダー ／ アクセントの青）
 * 目的: 静かで、声を出す前に少し落ち着ける画面。装飾より可読性と安全導線。
 */

:root {
  --navy: #101826;
  --navy-2: #16223a;
  --ink: #f8fafc;
  --accent: #8fb8ff;
  --lav: #c9bcf0;
  --muted: #a9b6cc;
  --body: #c6d3e8;
  --line: rgba(143, 184, 255, 0.22);
  --panel: rgba(255, 255, 255, 0.04);
  --radius: 16px;
  --max: 640px;
}

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

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

body {
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(115% 85% at 26% 6%, #1b2c4d 0%, #131e33 42%, var(--navy) 68%, #0a0f18 100%);
  background-attachment: fixed;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  line-height: 1.8;
  letter-spacing: 0.01em;
  padding-bottom: 96px; /* 常設の相談窓口ボタンと重ねない */
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- ベータ版公開バナー（毎日 05:00〜23:59） ---------- */

/* 上部に目立たせる。:root の落ち着いたトーンとは別に、期間限定であることだけを
   はっきり伝える（安全性の案内と取り違えないよう、下の注意書きとは配色を分ける）。 */
.beta-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  padding: 10px 14px max(10px, env(safe-area-inset-top));
  background: linear-gradient(96deg, #ff8a3d 0%, #ff5d7a 52%, #e2519f 100%);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.beta-bar[hidden] {
  display: none;
}

.beta-bar .beta-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.beta-bar #beta-text b {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.beta-bar .beta-count {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.beta-bar .beta-count[hidden] {
  display: none;
}

/* 時間外（毎日 0:00〜4:59 の休止中）は「公開中」と見間違えないよう、彩度を落として静かに閉じる。 */
.beta-bar.is-paused {
  background: linear-gradient(96deg, #3a4356 0%, #2b3346 100%);
  color: #d7deea;
  box-shadow: none;
}

.beta-bar.is-paused #beta-text b {
  font-size: 14px;
  font-weight: 700;
}

/* ---------- header ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.logo .word {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.logo .latin {
  font-size: 9px;
  letter-spacing: 0.42em;
  color: var(--accent);
  align-self: flex-end;
  margin-bottom: 5px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(143, 184, 255, 0.55);
  border-radius: 999px;
  background: rgba(143, 184, 255, 0.07);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ai-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 26px 0 10px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(30px, 8.6vw, 40px);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: 0.01em;
}

.hero .sub {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--body);
}

.rule {
  width: 96px;
  height: 2px;
  margin: 22px 0 6px;
  background: linear-gradient(90deg, var(--accent), rgba(143, 184, 255, 0));
}

.mascot-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.mascot-wrap img {
  width: min(210px, 52vw);
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
}

.chips li {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(143, 184, 255, 0.06);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- cards / sections ---------- */

.card {
  margin-top: 22px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card > h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 4px;
}

.card .lead {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.check-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.check-item:first-of-type {
  border-top: none;
}

.check-item .num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(143, 184, 255, 0.14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.check-item h3 {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.6;
}

.check-item p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--body);
}

.check-item .small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- consent form ---------- */

.consent-field {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.consent-field input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: #8fb8ff;
}

.consent-field span {
  font-size: 13.5px;
  line-height: 1.7;
}

.consent-field strong {
  font-weight: 700;
}

.consent-field .small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 400;
}

.form-note-left {
  text-align: left;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #a9c9ff, #7fabf5);
  color: #0b1220;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.45);
  cursor: not-allowed;
}

.btn-primary:not(:disabled):active {
  transform: translateY(1px);
}

.form-note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 188, 240, 0.4);
  border-radius: 12px;
  background: rgba(201, 188, 240, 0.1);
  color: #e7e0ff;
  font-size: 13px;
  line-height: 1.75;
}

.notice[hidden] {
  display: none;
}

/* ---------- status line ---------- */

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.status-line .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--body);
}

.status-line .pill .lamp {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ee0a8;
}

.status-line .pill.is-stopped .lamp {
  background: #f0b46a;
}

/* ---------- アプリ内ブラウザ（LINE・Instagram 等）の案内 ---------- */

/* 警告の琥珀色。ベータバナー（オレンジ〜ピンク）とは形・位置で区別できるようにする。 */
.inapp-card {
  margin: 16px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 176, 92, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 176, 92, 0.16), rgba(255, 176, 92, 0.06));
  color: #ffeed8;
  font-size: 13px;
  line-height: 1.75;
}

.inapp-card[hidden] {
  display: none;
}

.inapp-card .inapp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  color: #ffe6c4;
}

.inapp-card .inapp-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 176, 92, 0.24);
  border: 1px solid rgba(255, 176, 92, 0.5);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.inapp-card .inapp-head b {
  color: #fff;
}

.inapp-card .inapp-lead {
  margin: 10px 0 0;
}

.inapp-card .inapp-lead b {
  color: #fff;
}

.inapp-card .inapp-steps {
  margin: 10px 0 0;
  padding-left: 1.3em;
  color: #ffe6c4;
}

.inapp-card .inapp-steps li {
  margin-top: 3px;
}

.inapp-card .inapp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inapp-card .inapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 176, 92, 0.7);
  border-radius: 10px;
  background: rgba(255, 176, 92, 0.18);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.inapp-card .inapp-btn[hidden] {
  display: none;
}

/* LINE の緑。LINE 内ではこのリンクが外部ブラウザへ渡す唯一の頼りになる。 */
.inapp-card .inapp-btn-line {
  border-color: rgba(6, 199, 85, 0.8);
  background: rgba(6, 199, 85, 0.24);
}

.inapp-card .inapp-copy-note {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 12px;
  color: #ffe6c2;
}

.inapp-card .inapp-url {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: #e8cfae;
}

.inapp-card .inapp-url code {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* 長押し1回で全体を選べるようにする（アプリ内ブラウザは Clipboard API を拒むことがある）。 */
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: 34px;
  padding: 20px 0 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--muted);
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 8px;
}

.site-foot a {
  color: var(--body);
}

/* ---------- 常設「支援・相談窓口」 ---------- */

.help-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border: 1.5px solid rgba(143, 184, 255, 0.7);
  border-radius: 999px;
  background: rgba(16, 24, 38, 0.92);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.help-fab .mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #cfe0ff, #7fabf5);
}

/* ---------- 相談窓口モーダル ---------- */

.help-modal {
  width: min(560px, calc(100vw - 24px));
  max-height: 86dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(143, 184, 255, 0.35);
  border-radius: 18px;
  background: #121c2d;
  color: var(--ink);
  overflow: hidden;
}

.help-modal::backdrop {
  background: rgba(4, 8, 14, 0.72);
}

.help-modal .inner {
  max-height: 86dvh;
  overflow-y: auto;
  padding: 22px 20px 24px;
}

.help-modal h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.help-modal .lead {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.help-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.help-group {
  margin-top: 18px;
}

.help-group > h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

.help-item {
  display: block;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: var(--ink);
}

.help-item .name {
  font-size: 14px;
  font-weight: 700;
}

.help-item .tel {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.help-item .meta {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.help-item.is-urgent {
  border-color: rgba(255, 138, 138, 0.5);
  background: rgba(255, 138, 138, 0.08);
}

.help-item.is-urgent .tel {
  color: #ffb3b3;
}

.help-foot {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 文書ページ（規約・PP・404） ---------- */

.doc {
  padding: 8px 0 30px;
}

.doc h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 6px;
}

.doc .doc-meta {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.8;
}

.doc .doc-owner {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--body);
}

.doc .draft-banner {
  margin: 16px 0 8px;
  padding: 14px 16px;
  border: 1px solid rgba(240, 180, 106, 0.45);
  border-radius: 12px;
  background: rgba(240, 180, 106, 0.1);
  color: #f6e2c4;
  font-size: 12.5px;
  line-height: 1.8;
}

.doc h2 {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 16px;
  font-weight: 700;
}

.doc h3 {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.doc p,
.doc li {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--body);
}

.doc ul,
.doc ol {
  margin: 6px 0 0 20px;
}

.doc li {
  margin-top: 4px;
}

.doc .todo {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(240, 180, 106, 0.18);
  color: #f6e2c4;
  font-size: 12px;
  font-weight: 600;
}

.doc table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
}

.doc th,
.doc td {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}

.doc th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: var(--ink);
}

.doc .back {
  display: inline-block;
  margin-top: 28px;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 通話画面（S1） ---------- */

.call-page .wrap {
  padding-top: 4px;
}

.call-stage {
  margin-top: 20px;
  padding: 26px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  text-align: center;
}

.mascot-live {
  width: 148px;
  height: 148px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(143, 184, 255, 0.22), rgba(16, 24, 38, 0) 70%);
}

.mascot-live img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.mascot-quiet img {
  opacity: 0.86;
}

.call-phase {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.timer {
  margin: 14px auto 0;
  width: 100%;
  max-width: 320px;
}

.timer-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.timer-label {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}

.timer-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.timer-bar > span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fb8ff, #c9bcf0);
  transition: width 0.25s linear;
}

.call-hint {
  margin: 14px auto 0;
  max-width: 460px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.call-stage .btn-primary {
  margin-top: 18px;
}

.btn-quiet {
  margin-top: 14px;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-link {
  display: inline-block;
  margin-top: 18px;
  text-decoration: none;
  text-align: center;
}

.call-notes ul {
  margin-top: 8px;
  padding-left: 1.1em;
  font-size: 13px;
  line-height: 1.9;
  color: var(--body);
}

.call-notes li {
  margin-top: 4px;
}

.end-note {
  margin: 14px auto 0;
  max-width: 460px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 危機時の案内（画面に残る） ---------- */

.crisis-panel {
  margin-top: 20px;
  padding: 22px 20px;
  border: 1.5px solid rgba(255, 176, 176, 0.5);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 138, 138, 0.12), rgba(255, 138, 138, 0.04));
}

.crisis-panel[hidden] {
  display: none;
}

.crisis-level {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffc2c2;
}

.crisis-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
}

.crisis-line {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--body);
}

.crisis-windows {
  margin-top: 14px;
}

.crisis-foot {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.help-item.is-emphasis {
  border-color: rgba(143, 184, 255, 0.5);
}

.help-group-hint {
  margin: -2px 0 8px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 模擬危機試験A層のパネル（テスト配信のみ） ---------- */

.test-panel .lead {
  color: var(--muted);
}

.test-cases {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.test-case {
  padding: 10px 12px;
  border: 1px dashed rgba(143, 184, 255, 0.45);
  border-radius: 10px;
  background: rgba(143, 184, 255, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}

.test-log {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--accent);
  min-height: 1.6em;
}
