/* =========================================================
   My Context — デザインシステム
   ネイティブアプリ品質を目指した、落ち着いた高級感のあるUI。
   ライト/ダーク両対応、固定シェル＋内部スクロール、ボトムシート。
   ========================================================= */

:root {
  /* 既定は「霧（kiri）」固定。OSのダーク設定では切り替えず、常に霧で表示する。 */
  color-scheme: light;

  /* 余白・角丸・モーション（禅：少し大きめの角丸で柔らかく） */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --gap: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shell-max: 1080px;

  /* 書体（禅）：UIはゴシック、本人の言葉は明朝で一次資料として保全する */
  --font-ui: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-mincho: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;

  /* 霧（kiri）— 涼やかな水面。既定（ライト） */
  --bg: #e7eaec;
  --bg2: #dde1e4;
  --bg-grad-1: rgba(35, 40, 44, 0.05);
  --bg-grad-2: rgba(90, 117, 133, 0.05);
  --surface: #f3f5f6;
  --surface-2: #e9eced;
  --surface-3: #dde2e4;
  --ink: #23282c;
  --ink-soft: #6c7780;
  --ink-faint: #9aa4ac;
  --line: rgba(35, 40, 44, 0.10);
  --line-strong: rgba(35, 40, 44, 0.16);
  --accent: #5a7585;
  --accent-press: #496374;
  --accent-ink: #456072;
  --accent-soft: rgba(90, 117, 133, 0.12);
  --on-accent: #ffffff;

  /* 砂・水面・小石・波紋（見えてきたこと） */
  --sand: #e1e5e7;
  --sand-line: rgba(35, 40, 44, 0.05);
  --stone-1: #c0c8cd;
  --stone-2: #aab4ba;
  --stone-edge: rgba(35, 40, 44, 0.14);
  --ripple-ring: rgba(90, 117, 133, 0.42);
  --ripple-core: rgba(90, 117, 133, 0.9);

  /* 補助の意味色（結果カード等の他画面で使用。禅の地に馴染むよう中和） */
  --rose: #9c5563;
  --rose-soft: #e6dee0;
  --rose-ink: #7e2f3a;
  --gold: #8a6a3c;
  --gold-soft: #e6e1d6;
  --gold-ink: #5f4a23;

  /* 影 */
  --shadow-soft: 0 2px 14px rgba(35, 40, 44, 0.06);
  --shadow-sm: 0 1px 2px rgba(35, 40, 44, 0.06), 0 2px 8px rgba(35, 40, 44, 0.05);
  --shadow: 0 1px 2px rgba(35, 40, 44, 0.06), 0 8px 28px rgba(35, 40, 44, 0.08);
  --shadow-md: 0 10px 30px rgba(35, 40, 44, 0.10);
  --shadow-lg: 0 24px 60px rgba(35, 40, 44, 0.16);

  /* 旧・ユーザー吹き出し（禅では右寄せ＋右ボーダーに変更。互換のためトークンは残す） */
  --user-bubble: #5a7585;
  --user-bubble-ink: #ffffff;
}

/* 墨（sumi）— 深い炭。既定は霧。将来 <html data-theme="sumi"> を付けた時だけ適用する（自動切替しない）。 */
:root[data-theme="sumi"] {
    /* 墨（sumi）— 深い炭。ダーク */
    --bg: #16140f;
    --bg2: #1c1a13;
    --bg-grad-1: rgba(207, 141, 91, 0.06);
    --bg-grad-2: rgba(236, 230, 216, 0.03);
    --surface: #201d16;
    --surface-2: #26221a;
    --surface-3: #2e2920;
    --ink: #ece6d8;
    --ink-soft: #9b927f;
    --ink-faint: #6d6657;
    --line: rgba(236, 230, 216, 0.10);
    --line-strong: rgba(236, 230, 216, 0.18);
    --accent: #cf8d5b;
    --accent-press: #e0a978;
    --accent-ink: #e0a978;
    --accent-soft: rgba(207, 141, 91, 0.12);
    --on-accent: #1a1206;

    --sand: #1c1a14;
    --sand-line: rgba(236, 230, 216, 0.04);
    --stone-1: #4a4537;
    --stone-2: #37332a;
    --stone-edge: rgba(236, 230, 216, 0.14);
    --ripple-ring: rgba(207, 141, 91, 0.40);
    --ripple-core: rgba(207, 141, 91, 0.9);

    --rose: #df93a0;
    --rose-soft: #33241f;
    --rose-ink: #f0c2c9;
    --gold: #d7a767;
    --gold-soft: #332b1f;
    --gold-ink: #ecd2a6;

    --shadow-soft: 0 2px 18px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 34px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.62);

    --user-bubble: #cf8d5b;
    --user-bubble-ink: #1a1206;
}

/* 夜（yoru）— 生きた背景と同じ青墨系。背景だけでなく、文字・面・線も一緒に沈める。 */
:root[data-theme="yoru"],
:root[data-theme="night"],
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #172027;
  --bg2: #1c2831;
  --bg-grad-1: rgba(155, 182, 196, 0.12);
  --bg-grad-2: rgba(78, 108, 124, 0.12);
  --surface: rgba(31, 42, 50, 0.88);
  --surface-2: rgba(39, 53, 63, 0.92);
  --surface-3: rgba(49, 66, 78, 0.96);
  --ink: #e4edf1;
  --ink-soft: #a8b8c1;
  --ink-faint: #748692;
  --line: rgba(218, 235, 242, 0.13);
  --line-strong: rgba(218, 235, 242, 0.23);
  --accent: #9bb6c4;
  --accent-press: #b2cbd6;
  --accent-ink: #c8dce5;
  --accent-soft: rgba(155, 182, 196, 0.17);
  --on-accent: #14212a;

  --sand: #1d2a33;
  --sand-line: rgba(218, 235, 242, 0.06);
  --stone-1: #394b56;
  --stone-2: #2d3d47;
  --stone-edge: rgba(218, 235, 242, 0.14);
  --ripple-ring: rgba(155, 182, 196, 0.44);
  --ripple-core: rgba(190, 214, 224, 0.9);

  --rose: #e6a0ae;
  --rose-soft: rgba(230, 160, 174, 0.15);
  --rose-ink: #f3c7d0;
  --gold: #d7b47a;
  --gold-soft: rgba(215, 180, 122, 0.15);
  --gold-ink: #ead3a8;

  --shadow-soft: 0 2px 16px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24), 0 2px 10px rgba(0, 0, 0, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.26), 0 10px 34px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 38px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 28px 68px rgba(0, 0, 0, 0.44);

  --user-bubble: #9bb6c4;
  --user-bubble-ink: #14212a;
  --cta-consult-bg: #86a2af;
}

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

/* HTML の hidden 属性は、後続の display 指定に常に勝つようにする */
[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  /* ★縦の overflow:hidden は付けない＝ブラウザ標準の「下に引っ張って更新（プル・トゥ・リフレッシュ）」を残す。
     キーボードで画面が崩れる問題は、各画面を flex で高さ充填する方式（#app / #app > *）で解決済み。 */
  /* ★横方向だけは隠す＝画面を左右にスライドできてしまう（横オーバーフロー）のを止める。
     これがあると、オンボでスワイプした時にページが横にずれ、ホームツアーのスポット位置までズレていた（作者FB 2026-06-13）。
     縦（プル更新）は overflow-y に触らないので維持される。 */
  overflow-x: hidden;
  overscroll-behavior-x: none;
  max-width: 100%;
}

body {
  min-width: 0;
  margin: 0;
  background:
    radial-gradient(120% 80% at 85% -10%, var(--bg-grad-1), transparent 60%),
    radial-gradient(120% 90% at -10% 110%, var(--bg-grad-2), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root[data-theme="yoru"] body,
:root[data-theme="night"] body,
:root[data-theme="dark"] body {
  background:
    radial-gradient(120% 92% at 72% 6%, rgba(63, 84, 96, 0.76), transparent 60%),
    radial-gradient(120% 90% at 6% 110%, rgba(25, 36, 44, 0.88), transparent 58%),
    var(--bg);
}

/* 本人の言葉（一次資料）は明朝で保全する（禅デザインの原則） */
.mincho {
  font-family: var(--font-mincho);
}

button,
textarea,
input,
select {
  font: inherit;
  color: inherit;
}

/* iOSは16px未満の入力欄にフォーカスするとページ全体を自動ズームする。
   画面ごとの個別指定やインラインstyleより強く、文字入力系だけを16px以上に固定する。 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  font-size: 16px !important;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

/* アクセント面のボタンは、白系のアウトラインで見やすく */
.primary-button:focus-visible,
.send-button:focus-visible {
  outline-color: var(--on-accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent-soft);
}

/* ---------- アプリシェル（固定100dvh、内部スクロール） ---------- */

.app-shell {
  /* 生きた背景（#ambientCanvas）より前面に重ねる */
  position: relative;
  z-index: 1;
  /* アンビエントモードから戻る時のフェードイン（入りは body.ambient-zen 側の 0.8s が優先） */
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* モバイルブラウザのアドレスバー等を引いた「最小ビューポート(svh)」を採用し、
     下部の操作ボタン（入力欄・ここまでをまとめる/保存して終わる）が常に画面内に収まるようにする。
     dvh はバーの開閉で高さが変わり、下端が一瞬隠れる（＝まとめるが見えない・要スクロール）ことがあった。
     svh で隙間が出ても body 背景＝アプリと同色(#e7eaec)なので継ぎ目は見えない。 */
  height: 100vh; /* 古いブラウザ用フォールバック */
  height: 100svh;
  height: var(--app-h, 100svh); /* JS(setupViewportHeight)が visualViewport の実高さを流し込む＝キーボードで下端が隠れない */
  overflow: hidden;
}

/* ===== 生きた背景（ambient.js が描く Canvas）。app-shell の背面いっぱいに固定 ===== */
#ambientCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* ambient 有効時＝bodyのグラデは canvas が代替する（二重描画を避ける）。
   停止（3段階目）もキャンバスは表示したまま＝ambient.js の bare モードがエフェクト層だけ描かない（z358）。
   （z353の旧方式＝キャンバス非表示＋この背景で代替は、夜トーンで景色が別物になった。
     body.ambient-stopped クラスは状態の印としてだけ残っている＝ここでの見た目制御は無し） */
body.ambient-on {
  background: none;
}

/* 起動イントロ：背景が一度だけ呼吸し、ワードマークが淡く現れて消える */
#bootIntro {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 70px;
  pointer-events: none;
}

#bootIntro .boot-mark {
  font-family: var(--font-mincho);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.26s ease-out;
}

#bootIntro.in .boot-mark {
  opacity: 0.94;
}

#bootIntro.out .boot-mark {
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  #bootIntro {
    display: none;
  }
}

/* 6日目のソフト通知。画面を奪わず、必要な人だけ全画面へ進める */
.trial-day6-banner {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 54px);
  left: 14px;
  right: 14px;
  z-index: 4;
  pointer-events: none;
}

.trial-day6-banner[hidden] {
  display: none;
}

.trial-day6-banner button {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 10px 14px;
  pointer-events: auto;
}

.trial-day6-banner span {
  font-size: 13.5px;
  font-weight: 700;
}

.trial-day6-banner small {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* 7日後の全画面ペイウォール。シートではなく、呼吸する背景の上に重ねる */
.pw-takeover {
  position: fixed;
  inset: 0;
  z-index: 1180;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
}

.pw-takeover.open {
  opacity: 1;
  pointer-events: auto;
}

.pw-takeover[hidden] {
  display: none;
}

.pwt-act1,
.pwt-act2 {
  min-height: 100%;
  width: 100%;
}

.pwt-act1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px calc(env(safe-area-inset-bottom, 0px) + 34px);
  overflow: hidden;
}

.pwt-eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.pwt-sky {
  position: relative;
  width: min(78vw, 390px);
  aspect-ratio: 1 / 0.84;
  margin: 0 auto 18px;
}

.pwt-star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--delay);
}

.pw-takeover.act1-on .pwt-star {
  opacity: 0.95;
  transform: translate(-50%, -50%) scale(1);
}

.pwt-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
}

.pwt-star-label {
  position: absolute;
  left: 14px;
  top: -7px;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.65s ease;
  transition-delay: calc(var(--delay) + 0.35s);
}

.pw-takeover.act1-on .pwt-star-label {
  opacity: 1;
}

.pwt-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease 2.9s;
}

.pw-takeover.act1-on .pwt-constellation {
  opacity: 0.34;
}

.pwt-constellation path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
}

.pwt-stats,
.pwt-grown,
.pwt-next {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease);
}

.pw-takeover.act1-on .pwt-stats {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 3.1s;
}

.pw-takeover.act1-on .pwt-grown {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 3.7s;
}

.pw-takeover.act1-on .pwt-next {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 4.4s;
}

.pwt-stats {
  margin: 4px 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: center;
}

.pwt-stats b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pwt-grown {
  margin: 0 0 18px;
  font-family: var(--font-mincho);
  font-size: 19px;
  line-height: 1.55;
}

.pwt-next,
.pwt-later,
.pwt-close,
.pwt-footer-links button {
  background: transparent;
  border: 0;
  color: var(--accent-ink);
  cursor: pointer;
}

.pwt-next {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 14px;
}

.pwt-act2 {
  position: relative;
  display: flex;
  justify-content: center;
}

.pwt-close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 14px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink-soft);
}

.pwt-scroll {
  width: min(100%, 520px);
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 58px) 20px calc(env(safe-area-inset-bottom, 0px) + 28px);
}

.pwt-act2 .eyebrow,
.pwt-title,
.pwt-lead,
.pwt-includes,
.pwt-plans,
.pwt-cta,
.pwt-disclosure,
.pwt-later,
.pwt-trust,
.pwt-details,
.pwt-footer-links {
  opacity: 0;
  transform: translateY(10px);
}

.pw-takeover.act2-on .pwt-act2 .eyebrow,
.pw-takeover.act2-on .pwt-title,
.pw-takeover.act2-on .pwt-lead,
.pw-takeover.act2-on .pwt-includes,
.pw-takeover.act2-on .pwt-plans,
.pw-takeover.act2-on .pwt-cta,
.pw-takeover.act2-on .pwt-disclosure,
.pw-takeover.act2-on .pwt-later,
.pw-takeover.act2-on .pwt-trust,
.pw-takeover.act2-on .pwt-details,
.pw-takeover.act2-on .pwt-footer-links {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.58s ease, transform 0.58s var(--ease);
}

.pw-takeover.act2-on .pwt-title { transition-delay: 0.05s; }
.pw-takeover.act2-on .pwt-lead { transition-delay: 0.22s; }
.pw-takeover.act2-on .pwt-includes { transition-delay: 0.32s; }
.pw-takeover.act2-on .pwt-plans { transition-delay: 0.4s; }
.pw-takeover.act2-on .pwt-cta,
.pw-takeover.act2-on .pwt-disclosure { transition-delay: 0.58s; }
.pw-takeover.act2-on .pwt-later,
.pw-takeover.act2-on .pwt-trust,
.pw-takeover.act2-on .pwt-details,
.pw-takeover.act2-on .pwt-footer-links { transition-delay: 0.75s; }

.pwt-title {
  margin: 8px 0 12px;
  font-family: var(--font-mincho);
  font-size: 24px;
  line-height: 1.52;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink);
}

.pwt-lead {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* プレミアムに含まれるもの（3.1.2(c)：折りたたまない常時表示の内容リスト） */
.pwt-includes {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.pwt-includes p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.pwt-includes p span {
  font-weight: 400;
  color: var(--ink-soft);
}

.pwt-includes ul {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.pwt-includes ul li {
  margin: 0;
}

.pwt-includes small {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

.pwt-plans {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.pwt-plan {
  position: relative;
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 15px 16px 14px;
  cursor: pointer;
}

.pwt-plan[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pwt-badge {
  position: absolute;
  top: -9px;
  left: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--accent);
  color: var(--on-accent);
  padding: 3px 10px;
  border-radius: 999px;
}

.pwt-plan-head,
.pwt-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pwt-plan-head b {
  font-size: 15px;
  color: var(--ink);
}

.pwt-plan-head small {
  font-size: 11px;
  color: var(--accent-ink);
  font-weight: 600;
}

.pwt-price {
  justify-content: flex-start;
  margin-top: 6px;
}

.pwt-price b {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pwt-price.monthly b {
  font-size: 20px;
  font-weight: 700;
}

.pwt-price small,
.pwt-note {
  font-size: 12px;
  color: var(--ink-soft);
}

.pwt-note {
  display: block;
  margin-top: 4px;
}

.pwt-cta {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
}

.pwt-diagnostic {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.65;
}

.pwt-diagnostic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pwt-diagnostic-head strong {
  color: var(--ink);
  font-size: 12.5px;
}

.pwt-diagnostic-head button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-ink);
  font-size: 11px;
  padding: 5px 10px;
}

.pwt-diagnostic pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font: inherit;
  color: var(--ink-soft);
}

.pwt-disclosure {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: center;
}

.pwt-later {
  display: block;
  min-height: 44px;
  margin: 10px auto 0;
  padding: 8px 16px;
  color: var(--ink-soft);
  font-size: 13px;
}

.pwt-trust {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 20px 0 18px;
  padding: 18px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pwt-trust div {
  text-align: center;
  padding: 0 4px;
}

.pwt-trust div + div {
  border-left: 1px solid var(--line);
}

.pwt-trust b {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 13px;
}

.pwt-trust span {
  display: block;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.65;
}

.pwt-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 12px;
}

.pwt-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

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

.pwt-details summary small {
  color: var(--ink-faint);
  font-weight: 400;
  white-space: nowrap;
}

.pwt-details ul {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.pwt-details p {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.7;
}

.pwt-details dl {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.pwt-details dt {
  color: var(--ink);
  font-weight: 700;
  margin-top: 10px;
}

.pwt-details dd {
  margin: 2px 0 0;
  padding: 0;
}

.pwt-footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pwt-footer-links button,
.pwt-footer-links a {
  min-height: 44px;
  padding: 4px 0;
  color: var(--accent-ink);
  font-size: 12px;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .pw-takeover,
  .pwt-star,
  .pwt-star-label,
  .pwt-constellation,
  .pwt-stats,
  .pwt-grown,
  .pwt-next,
  .pwt-act2 .eyebrow,
  .pwt-title,
  .pwt-lead,
  .pwt-plans,
  .pwt-cta,
  .pwt-disclosure,
  .pwt-later,
  .pwt-trust,
  .pwt-details,
  .pwt-footer-links {
    transition: none !important;
  }
}

/* ambient 有効時は静的背景SVG（砂紋・波紋）を薄く残す。消さない＝エフェクト無効端末のフォールバック。
   うるさければ 0 へ（まず 0.25 で試す＝実装仕様書 §3-3）。 */
body.ambient-on .g-sand,
body.ambient-on .g-ripple,
body.ambient-on .chat-ripple,
body.ambient-on .auth-ripple {
  opacity: 0.25;
}

/* 背景の一時停止ボタン（トップバー右・30px円・ボーダーなし・❚❚/▶）
   霧トーン：ほぼ不透明な --surface(#f3f5f6) の円が霧背景から浮いて見える（作者FB z350）
   → 半透明＋既存の backdrop-blur で霧に溶かし、アイコンも一段淡く（--ink-faint）。 */
.ambient-pause {
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(243, 245, 246, 0.5);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.15s var(--ease);
}

/* 夜・墨トーンは従来どおり（--surface 地に --ink-soft）＝「かなりいい感じ」を変えない */
:root[data-theme="yoru"] .ambient-pause,
:root[data-theme="night"] .ambient-pause,
:root[data-theme="dark"] .ambient-pause,
:root[data-theme="sumi"] .ambient-pause {
  background: var(--surface);
  color: var(--ink-soft);
}

.ambient-pause:active {
  transform: scale(0.92);
}

/* ★iOS(WebKit)専用・入力中だけ：アプリの箱を「見えている範囲」に固定する。
   原因＝iOSはキーボードを出すとページ全体をスクロールして入力欄を上げ、その分だけ箱ごと上にズレ、
   上の問い/ヘッダーが画面外へ消え、箱の下に body 背景（灰色）が露出する（実機計測で docScroll>0・shell.top=-docScroll を確認）。
   Android/PC は interactive-widget が効きページ自体が縮む（スクロールしない）ので起きない＝この対策は iOS だけに当て、Android体験は一切変えない。
   入力中だけ position:fixed で箱を visualViewport にピン留めし、ページのスクロール自体を無くす（top/height は JS が実寸で当てる）。
   入力していない時は通常フロー＝「下に引っ張って更新」も維持。 */
body.kb-pin .app-shell {
  position: fixed;
  left: 0;
  right: 0;
  top: 0; /* JS(updateIosKeyboardPin)が visualViewport.offsetTop/height を実寸で上書き */
}
/* キーボード中は箱が狭い（=visualViewport.height）ので、入力に集中できるよう上のワードマーク帯を隠して高さを稼ぐ。
   入力を終える（kb-pin解除）と元に戻る。iOSのキーボード中だけ＝Android/PCは常に表示のまま。 */
body.kb-pin .topbar {
  display: none;
}
/* 各画面を「箱の高さに収める」＝下の操作バー（保存/送信）を必ずキーボードの上に見せ、長い中身（チャットログ/日記textarea）は
   内部スクロールに回す。通常は #app > * を flex:1 0 auto（縮まない）にしているが、ピン留めで箱の高さが確定するこの状態だけ
   縮める（flex-shrink:1）＝下端の操作が画面外に押し出されない。iOSのキーボード中だけ。 */
body.kb-pin #app > * {
  flex: 1 1 auto;
  min-height: 0;
}
/* 日記：深掘りコントロールは下のバー(.jw-bar)の左に移したので、キーボード中も隠さない（バーは画面最下部で書く欄の高さを食わない）。
   旧「そのまま日記になります…」ヒントは撤去。iOSのキーボード中の挙動はバーごと固定されるので書く欄は従来どおり確保される。 */
/* ガイドの「味見」入力欄は画面中段（.guide-body の中）にあり、.guide-body は通常スクロールしない箱。
   キーボード中はページ全体を固定してスクロールを無くす（kb-pin）ため、隠れた入力欄を見せる scrollIntoView が
   スクロールする箱を見つけられず味見欄が出せなくなる。そこでキーボード中だけ .guide-body をスクロール箱にする＝
   updateIosKeyboardPin が呼ぶ revealFocusedInput が .guide-body を動かして味見欄を表示できる。iOSのキーボード中だけ。 */
body.kb-pin .guide-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  max-width: 100%;
  touch-action: pan-y;
}

.topbar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: min(var(--shell-max), 100%);
  margin: 0 auto;
  /* 上余白を詰める。env(safe-area-inset-top)＝ノッチ/Dynamic Island機だけその高さが自動で入り、無い機種は0。
     その上に足す余白を 12px→6px、非ノッチ機の最低値を 22px→8px に縮小（ロゴはノッチに隠れないまま、全体的に上へ詰まる）。 */
  padding: calc(max(env(safe-area-inset-top), 8px) + 4px) clamp(16px, 4vw, 28px) 8px;
}

/* タイトルは中央に、細くトラッキングしたワードマーク（設計の入口ヘッダーに合わせる） */
.brand {
  grid-column: 2;
  justify-self: center;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  padding-left: 0.38em; /* 字間の末尾分を相殺し、見た目を中央へ */
  white-space: nowrap;
  transition: color 0.15s var(--ease);
}

.brand:hover {
  color: var(--ink-soft);
}

.top-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.icon-button:active {
  transform: translateY(0);
}

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
}

/* ★各画面が必ず #app の高さを満たすように flex で埋める（重要）。
   日記・チャット・ガイド等は height:100% で高さを満たしていたが、iOS Safari では親(#app)の高さが
   flex 由来＝不定とみなされ % が解決せず、中身の高さに潰れて「入力欄が上に寄り下に空白」になっていた。
   #app を縦並び flex にし、各画面ルートを flex:1 で埋める＝% に依存せず確実に高さ一杯になる。
   背の高い画面は縮まずあふれて #app（overflow-y:auto）がスクロールする（クリップしない）。
   ※ #app（ID）で限定＝ホームのカード内 span.main 等には影響させない。 */
#app {
  display: flex;
  flex-direction: column;
  /* ★横方向は絶対にあふれさせない（画面が横に超過するのを防ぐ）。装飾SVGや非折返しテキストが
     WebKit(iPhoneのSafari/Chrome)で横にあふれて画面幅を超える問題のガード。縦スクロールは overflow-y:auto のまま。 */
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
#app > * {
  flex: 1 0 auto; /* 高さ一杯まで伸びる・縮まない（あふれたら #app がスクロール） */
  min-height: 0;
  max-width: 100%; /* 画面幅を超えない（横はみ出し防止） */
}

/* ボトムシート展開中は背後をスクロールさせない */
body.sheet-open .chat-log,
body.sheet-open .main {
  overflow: hidden;
}

/* ---------- 汎用 ---------- */

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-ink);
  /* 設計の .mc-eyebrow と同一（11px / 700 / 字間 0.16em） */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.lead {
  color: var(--ink-soft);
  font-size: 16.5px;
}

.muted {
  color: var(--ink-soft);
}

.primary-button {
  min-height: 50px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  /* 設計の .mc-btn と同じ 600（旧 800 は未読込ウェイトで 700 に丸められていた） */
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.primary-button:hover {
  background: var(--accent-press);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button.block,
.secondary-button.block {
  width: 100%;
}

.secondary-button {
  min-height: 50px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 700;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
}

.ghost-button {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* =========================================================
   入口（ホーム）：今日は、何の話から？ ／ ⋯メニュー
   ========================================================= */

/* 右上メニュー：白丸で囲まず、素の「⋯」だけ（設計に合わせる） */
.menu-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink-soft);
  border-radius: 50%;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.menu-button:hover {
  color: var(--ink);
  background: transparent;
  transform: none;
}

.entry {
  width: min(560px, 100%);
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 32px) clamp(20px, 6vw, 36px) calc(env(safe-area-inset-bottom) + 30px);
}

.entry-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* 中身が縦に収まる時は中央寄せ／キーボード等で縮んで収まらない時は上揃え＝上が見切れてスクロール不能になるのを防ぐ（safe）。 */
  justify-content: center;
  justify-content: safe center;
  gap: 20px;
  padding: 20px 0;
}

.entry-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

.entry-kicker {
  margin: 0;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.entry-prompt {
  margin: 0;
  /* 設計と同じ 30px 相当（375px幅で30px）。フォントは Zen Kaku Gothic New で同一。 */
  font-size: clamp(26px, 8vw, 32px);
  line-height: 1.5;
  /* 太さは作者の希望で 400（設計の 500 より軽く＝入口を静かに見せる） */
  font-weight: 400;
  letter-spacing: 0.02em;
}

.entry-reassure {
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

/* ===== 新ホーム（はなす／つかう）＋「問いで発見する」画面（Claude Designの使用感に合わせたガワ） ===== */
.home2 {
  gap: 30px;
  padding-top: clamp(20px, 7vw, 46px);
}
.home2-sec {
  display: flex;
  flex-direction: column;
}
.home2-sec[hidden] {
  display: none;
}
.home2-eyebrow {
  margin: 0 0 12px;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.home2-title {
  margin: 0 0 12px;
  font-size: clamp(26px, 8vw, 33px);
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.home2-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}
.home2-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home2-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.home2-card:hover {
  border-color: var(--accent);
}
.home2-card.subtle {
  background: transparent;
  box-shadow: none;
  border-color: var(--line);
}
.home2-card-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.home2-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.home2-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.home2-card-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.home2-card-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-faint);
}
.home2-card-chev {
  flex: none;
  color: var(--ink-faint);
  font-size: 20px;
}
.home2 .entry-privacy {
  margin-top: auto;
}

/* 「問いで発見する」画面 */
.screen-back {
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 4px 2px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}
.screen-back:hover {
  color: var(--accent-ink);
}
.discover {
  padding-top: clamp(16px, 5vw, 30px);
}
.discover .entry-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.discover-label {
  margin: 4px 0 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 600;
}
.discover-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--accent-ink);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.discover-cta-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.discover-cta-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.discover-cta-title {
  font-size: 16px;
  font-weight: 700;
}
.discover-cta-desc {
  font-size: 12.5px;
  opacity: 0.85;
  line-height: 1.6;
}
.discover-cta .home2-card-chev {
  color: rgba(255, 255, 255, 0.7);
}
.discover-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--ink-faint);
  font-size: 12px;
}
.discover-divider::before,
.discover-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.discover .entry-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.discover .entry-chip.more {
  grid-column: 1 / -1;
}
.discover .entry-write,
.discover .entry-mode {
  margin-top: 14px;
}

/* 日記の「受け取りました。」リザルト画面 */
.jdone {
  padding-top: clamp(16px, 5vw, 30px);
}
.jdone-date {
  margin: 16px 0 8px;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
}
.jdone-body {
  margin-bottom: 6px;
}
.jdone-para {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  white-space: pre-wrap; /* 書く画面(.jw-flow-you)と同じく、本人が入れた改行をそのまま残す */
  word-break: break-word;
}
.jdone-para:last-child {
  margin-bottom: 0;
}
.jdone-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}
.jdone-primary {
  padding: 15px;
  border-radius: var(--r-md);
  background: var(--accent-ink);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}
.jdone-close {
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}
.jdone-close:hover {
  color: var(--accent-ink);
}

/* そっと、見えてきたこと（還元の可視化・断定せず控えめに） */
.jdone-seen {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.jdone-seen-head {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.jdone-seen-loading {
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
}
.jdone-seen-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.jdone-seen-row:first-of-type {
  border-top: 0;
}
.jdone-seen-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-ink);
  line-height: 1.5;
}
.jdone-seen-value {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.65;
}
.jdone-seen-foot {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* よかったら、もう少しだけ（任意の一問＝日記と対話の橋） */
.jdone-ask {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.jdone-ask-head {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}
.jdone-ask-q {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}
.jdone-ask-actions {
  display: flex;
  gap: 10px;
}
.jdone-ask-yes {
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--accent-ink);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.jdone-ask-no {
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

/* 4つの話題を2×2グリッドで（全部同じ大きさ） */
.entry-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.entry-chip {
  padding: 11px 17px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.entry-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.entry-chip:active {
  transform: scale(0.97);
}

/* 「その他の話題」シートの中身 */
.topic-sheet-note {
  margin: 0 6px 14px;
  color: var(--ink-soft);
  font-size: 13px;
}
.topic-group {
  margin-bottom: 18px;
}
.topic-group-label {
  margin: 0 4px 9px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topic-chip {
  padding: 10px 15px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.topic-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.topic-chip:active {
  transform: scale(0.97);
}

/* 「話を振ってほしい」：完全受け身の入口（AIから振る）。チップとは別の、やさしい誘いのボタン */
/* 下段の固定2つ（その他の話題／話を振ってほしい）を横並び1行に */
.entry-lead {
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.entry-fixed-btn {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.entry-fixed-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.entry-fixed-btn:active { transform: scale(0.98); }
/* 「その他の話題」＝点線で控えめに（"入口がもっとある"合図） */
.entry-fixed-btn.more {
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent-ink);
  background: transparent;
}
/* 「話を振ってほしい」＝重要機能なので accent の淡い地で少し主張（でも溶け込む） */
.entry-fixed-btn.lead {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.entry-write {
  display: flex;
}

/* 日記の入口（控えめなテキストリンク。.entry-write-toggle を流用＝同じ静かなトーン）。 */
.entry-journal {
  display: flex;
  margin-top: 2px;
}

.entry-write-toggle {
  align-self: flex-start;
  padding: 4px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 13px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.entry-write-toggle:hover {
  color: var(--ink-soft);
  border-bottom-color: var(--line-strong);
}

/* 2-3 「今日は軽めに」：任意の対話モード。入口の静けさを壊さない極小・控えめ。既定オフ＝ほぼ気配だけ。 */
.entry-mode {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 中央列にセグメント本体＝画面中央に。ラベルは左列に右寄せで添える（やや右寄り見えの解消） */
  align-items: center;
  margin: 14px 0 18px; /* 上下に余白＝「話を振ってもらう」と密着させない（作者FB） */
}

/* 対話ペースの3段セグメント（さっと/ふつう/じっくり）＝入口で先に選び、出口の期待値を立てる */
.pace-label { grid-column: 1; justify-self: end; padding-right: 8px; font-size: 12px; color: var(--ink-faint); }
.pace-seg { grid-column: 2; display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--accent-soft); }
.pace-opt { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; padding: 5px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.pace-opt .pace-t { font-size: 12.5px; font-weight: 600; }
.pace-opt .pace-n { font-size: 10px; color: var(--ink-faint); }
.pace-opt.is-on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-soft); }
.pace-opt.is-on .pace-n { color: var(--accent-ink); opacity: 0.75; }

.entry-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 12.5px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.entry-mode-toggle:hover {
  color: var(--ink-soft);
}

.entry-mode-toggle.on {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ホームの「いまの私（役割＝分人）」セレクタ。チャットの「いま：◯◯」と同じ作法の控えめピル。 */
/* 「いまの私」と「問いの立て方」を同じ行に横並び（収まらない時だけ折り返す） */
.entry-selectors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
}
.entry-role {
  display: flex;
  justify-content: center;
}
.entry-role:empty {
  display: none; /* 片方が非表示の時、横並びの余分な隙間を作らない */
}

.entry-role-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-size: 12.5px;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.entry-role-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.entry-role-btn.ghost {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  color: var(--ink-faint);
}

.entry-role-now {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
}

.entry-role-btn strong {
  color: var(--accent-ink);
  font-weight: 800;
}

.entry-role-caret {
  color: var(--ink-faint);
  font-size: 11px;
}

.entry-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-bottom: 1.5px solid var(--line-strong);
  padding-bottom: 10px;
}

.entry-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}

.entry-input:focus {
  outline: none;
}

.entry-go {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s var(--ease);
}

.entry-go:active {
  transform: scale(0.92);
}

.entry-foot {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
}
/* 2-1 プライバシー透明性："使う前"にそっと安心を渡す。entry-foot より小さく・控えめに。 */
.entry-privacy {
  margin: 10px auto 0;
  max-width: 30em;
  padding: 0 14px;
  text-align: center;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-faint);
  opacity: 0.8;
}

/* ===== 初回言語選択（ログイン・ガイドより前に1度だけ表示） ===== */
body.language-choice-screen {
  overflow: hidden;
}

.language-choice-gate {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: var(--app-h, 100svh);
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px);
  overflow-y: auto;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.language-choice-gate[hidden] {
  display: none;
}

.language-choice-card {
  width: min(460px, 100%);
  box-sizing: border-box;
  padding: clamp(28px, 7vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.language-choice-brand {
  margin: 0 0 28px;
  color: var(--ink);
  font-family: var(--font-mincho);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.language-choice-eyebrow {
  margin: 0 0 10px;
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.language-choice-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 400;
  line-height: 1.45;
}

.language-choice-title [lang="ja"] {
  color: var(--ink-soft);
  font-size: 0.72em;
}

.language-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.language-choice-option {
  position: relative;
  min-height: 118px;
  padding: 24px 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.language-choice-option:hover,
.language-choice-option:focus-visible,
.language-choice-option.recommended {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.language-choice-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-color: color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 3px;
}

.language-choice-option:active {
  transform: scale(0.98);
}

.language-choice-option:disabled {
  cursor: wait;
  opacity: 0.68;
}

.language-choice-option strong,
.language-choice-option small {
  display: block;
}

.language-choice-option strong {
  font-size: 20px;
  font-weight: 600;
}

.language-choice-option small {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.language-choice-badge {
  position: absolute;
  top: 9px;
  left: 50%;
  display: none;
  width: max-content;
  max-width: calc(100% - 16px);
  transform: translateX(-50%);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.language-choice-option.recommended .language-choice-badge {
  display: block;
}

.language-choice-note {
  margin: 22px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.7;
}

@media (max-width: 350px) {
  .language-choice-options {
    grid-template-columns: 1fr;
  }
  .language-choice-option {
    min-height: 92px;
  }
}

/* ===== ログイン画面（メール＋Google・Supabase設定時のみ表示） ===== */
.auth-center {
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.15s var(--ease);
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.auth-google:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.auth-google:active {
  transform: translateY(0);
}

.auth-message {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--accent-ink);
}

.auth-message.error {
  color: var(--rose);
}

/* ログイン画面の背景：水面の干渉波（ジャーナリング・問いと同じモチーフ＝入口のテンションを上げる）。本体は上に重ねる。 */
.entry.auth { position: relative; }
.auth-ripple { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.auth-ripple circle { fill: none; stroke: var(--accent); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.entry.auth > *:not(.auth-ripple) { position: relative; z-index: 1; }

/* 送信中：控えめなドット */
.auth-loading { display: inline-flex; align-items: center; gap: 8px; }

/* 送信済み：背景に溶けないパネル＋待機中の波紋パルス（この案内が必ず読まれるように・トンマナは水の波紋で維持） */
.auth-message.sent {
  display: flex; align-items: flex-start; gap: 13px;
  margin-top: 4px; padding: 14px 16px;
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink);
  animation: authSentIn .45s ease both;
}
@keyframes authSentIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.auth-sent-pulse {
  flex: none; position: relative; width: 12px; height: 12px; margin-top: 4px;
  border-radius: 50%; background: var(--accent);
}
.auth-sent-pulse::before, .auth-sent-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--accent); animation: authPulse 2.4s ease-out infinite;
}
.auth-sent-pulse::after { animation-delay: 1.2s; }
@keyframes authPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.4); opacity: 0; } }
.auth-sent-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.auth-sent-head { font-size: 13.5px; font-weight: 700; color: var(--accent-ink); letter-spacing: .01em; }
.auth-sent-text { font-size: 13px; line-height: 1.7; color: var(--ink); }
.auth-sent-wait { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 11.5px; color: var(--accent-ink); opacity: .82; }
@media (prefers-reduced-motion: reduce) {
  .auth-sent-pulse::before, .auth-sent-pulse::after { animation: none; }
  .auth-message.sent { animation: none; }
}

/* ログイン画面では右上の ⋯ メニューを出さない（未ログインでは保存箱・設定は不要） */
body.auth-screen .top-actions {
  display: none;
}

/* はじめてのガイド表示中は、右上の ⋯ メニューを出さない＝ガイドが終わるまで離脱導線を作らない（全員に読んでもらう） */
body.guide-screen .top-actions {
  display: none;
}
/* ★初回チュートリアル中だけ＝上の「My Context」ロゴでホームへ抜けられないようにする（作者FB 2026-06-13）。
   route() の guard が hash 遷移自体も #guide へ戻すが、見た目でも押せないことを示す（カーソル・タップ無効）。
   メニュー再読（guide-screen だが guide-forced は付かない）はロゴで自由に戻れる。 */
body.guide-forced .brand {
  pointer-events: none;
  cursor: default;
}

/* これまでの話（名前つきスレッド）の一覧 */
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color 0.15s var(--ease);
}

.thread-card:hover {
  border-color: var(--line-strong);
}

.thread-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  text-align: left;
  background: transparent;
  border: 0;
  transition: background 0.14s var(--ease);
}

.thread-card-main:hover {
  background: var(--accent-soft);
}

.thread-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-card-snippet {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-card-meta {
  font-size: 11px;
  color: var(--ink-faint);
}

.thread-card-actions {
  display: flex;
  flex: none;
}

.thread-card-btn {
  width: 42px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 14px;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.thread-card-btn:hover {
  background: var(--surface-2);
  color: var(--ink-soft);
}

.thread-card-btn.del:hover {
  color: var(--rose);
}

/* ホームの「相談を磨く」導線 */
.home-consult-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  color: var(--accent-ink);
  font-size: 14.5px;
  font-weight: 700;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.home-consult-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

/* 「どの私？」役割(分人)の選択リスト。行は .thread-card と同じ作法（✎✕は .thread-card-btn を流用）。 */
.role-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-row {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color 0.15s var(--ease);
}

.role-row.on {
  border-color: var(--accent);
}

.role-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  text-align: left;
  background: transparent;
  border: 0;
  transition: background 0.14s var(--ease);
}

.role-row-main:hover {
  background: var(--accent-soft);
}

.role-row-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-row-meta {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.role-row-actions {
  display: flex;
  flex: none;
}

.role-add {
  margin-top: 12px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.role-add:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

/* 「これまでの話」を私(役割)ごとにまとめる見出し */
.thread-group + .thread-group {
  margin-top: 18px;
}

.thread-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.thread-group-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
}

/* 相談デスク：人格（スレッド）ピッカー「どのあなたで考える？」 */
.consult-personas {
  margin-bottom: 16px;
}

.consult-personas-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.persona-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.persona-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease), color 0.14s var(--ease);
}

.persona-chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.persona-chip.on::before {
  content: "✓ ";
}

.persona-chip.fixed {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  cursor: default;
}

/* ⋯メニュー（ボトムシート） */
#menuBackdrop {
  z-index: 55;
}

.menu-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(var(--shell-max), 100%);
  margin: 0 auto;
  max-height: 80svh;
  max-height: 80dvh;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  /* 影は .open の時だけ付ける。閉時は translateY(101%) で画面直下に待機しているため、
     常時影だと全シート分のぼかしが画面下端へはみ出して重なり、底に固定の暗い帯として見える */
  box-shadow: none;
  transform: translateY(101%);
  /* opacity も遷移させる＝設定サブシート表示中に1枚目が「奥に沈む」動き（.behind）用 */
  transition: transform 0.34s var(--ease), opacity 0.3s ease, box-shadow 0.34s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

.menu-sheet.open {
  transform: translateY(0);
  box-shadow: var(--shadow-lg);
}

/* 閉じている／閉じアニメ中のシートは、タップを素通しにする。
   閉じ遷移（0.34s）の間もシートは z-index 60/30 のまま画面下部を覆っており、
   閉じた直後のホーム操作を行ボタンが吸ってしまう＝「まれにタップの判定がずれる」の原因（作者FB z350）。
   開く時は .open が即付与されるので、開いたシートの操作には影響しない。 */
.menu-sheet:not(.open),
.context-panel:not(.open) {
  pointer-events: none;
}

.menu-sheet-inner {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* プルダウン展開時に内側スクロールが背面へ抜けないように */
  overscroll-behavior-x: none;
  touch-action: pan-y;
  padding: 2px clamp(16px, 4vw, 22px) calc(env(safe-area-inset-bottom) + 22px);
}

.menu-sheet .eyebrow {
  margin: 2px 6px 8px;
}
/* メニューのグループ小見出し（あなたの記録／コンテキスト／設定・サポート）。薄く小さく、上に余白でグループを分ける。 */
.menu-group-label {
  margin: 18px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.menu-group-label[hidden] { display: none; }

.menu-row {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 6px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.14s var(--ease);
}

.menu-row:last-of-type {
  border-bottom: 0;
}

.menu-row:hover {
  background: var(--surface-2);
}

.menu-row:active {
  background: var(--accent-soft);
}

/* シートで「いま選ばれている」行を強調（問いの立て方の現在値など） */
.menu-row.on {
  background: var(--accent-soft);
}
.menu-row.on .menu-row-label::before {
  content: "✓ ";
  color: var(--accent-ink);
  font-weight: 700;
}

.menu-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.menu-row-label {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.menu-row-count {
  margin-left: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-faint);
}

.menu-row-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  min-width: 0;
  overflow-wrap: anywhere;
}

.menu-row-chev {
  flex: none;
  color: var(--ink-faint);
  font-size: 22px;
  line-height: 1;
}

.menu-foot {
  margin: 14px 6px 2px;
  font-size: 11.5px;
  line-height: 1.6;
}

/* テスト中のバージョン表示（控えめ・等幅で読みやすく） */
.menu-version {
  margin: 8px 6px 0;
  font-size: 10.5px;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

/* ===== メニュー再構成（z316）：1行表記・エフェクトプルダウン・設定サブシート・プレミアムカード ===== */
/* 1行表記の行（説明文なし）。従来の2行行（.menu-row-main入り）より少し詰める。 */
.menu-row-slim {
  padding: 14px 6px;
}

/* 行の右端（件数・現在値・›）をひとまとめに */
.menu-row-meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.menu-row-meta .menu-row-count {
  margin-left: 0;
}

/* 未処理の振り分けがある時だけ最上部に出るアクセント帯 */
.menu-sort-band {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  text-align: left;
}
.menu-sort-band[hidden] {
  display: none;
}
.menu-sort-band-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-ink);
}
.menu-sort-band .menu-row-chev {
  color: var(--accent-ink);
}

/* エフェクト行の直下に展開するプルダウン（雨/滴/にじみ/墨流し） */
.menu-fx-chev {
  font-size: 13px;
  line-height: 1;
  color: var(--ink-faint);
}
.menu-fx-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.55s var(--ease), opacity 0.45s ease;
}
.menu-fx-wrap.open {
  max-height: 220px;
  opacity: 1;
}
.menu-fx-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px 11px 26px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.menu-fx-opt.on {
  color: var(--accent);
  font-weight: 600;
}
.menu-fx-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  box-sizing: border-box;
}
.menu-fx-opt.on .menu-fx-mark {
  border: 0;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(90, 117, 133, 0.7);
}

/* プレミアム購読の独立カード（枠線・タイトル＋一行説明） */
.menu-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 4px;
  padding: 15px 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: background 0.14s var(--ease);
}
.menu-card:active {
  background: var(--accent-soft);
}
.menu-card[hidden] {
  display: none;
}
.menu-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.menu-card-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* 夜トーンのシートは背景から浮きすぎない程度に、不透明度を少し上げる。 */
:root[data-theme="yoru"] .menu-sheet,
:root[data-theme="night"] .menu-sheet,
:root[data-theme="dark"] .menu-sheet,
:root[data-theme="yoru"] .context-panel,
:root[data-theme="night"] .context-panel,
:root[data-theme="dark"] .context-panel {
  background: rgba(29, 39, 47, 0.96);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

/* フッター1行：「プライバシーについて ・ ver」（狭い端末では ver だけ折り返す） */
.menu-foot-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
}
.menu-foot-line .menu-version {
  margin: 0;
}
.menu-foot-link {
  flex: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 4px 2px;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 設定サブシート（2枚目）が開いている間、1枚目のメニューは奥に沈む。
   ★沈んでいる間はタップも受け取らない（pointer-events:none）＝見た目どおり無効。
     これが無いと、設定シートの上の空き領域で沈んだメニューの行（取り込む等）が押せてしまう（テスターFB 2026-07-20）。
     素通りしたタップは #menuBackdrop に届く＝「外を押したら全部閉じる」が正しく機能する。 */
.menu-sheet.open.behind {
  transform: translateY(26px) scale(0.975);
  opacity: 0.45;
  pointer-events: none;
}

/* サブシートの「もどる」 */
.menu-sub-back {
  border: 0;
  background: transparent;
  padding: 8px 6px 2px;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* 設定サブシート内の「AIへの送信」トグル置き場（プライバシー内と同じ見た目・行間に馴染ませる） */
.settings-consent {
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}

/* 言語切替はOS標準のselectを使い、選択肢とキーボード操作をそのまま利用できるようにする。 */
.settings-language-row {
  cursor: pointer;
}

.settings-language-select {
  max-width: 10em;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-align: right;
  text-align-last: right;
  cursor: pointer;
}

.settings-language-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 取り込み画面の「詳細ノート（原文）」入口のプロバッジ（メニューから移設・z316） */
.imp-pro-badge {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

/* エフェクトのプルダウン展開時でもメニューがはみ出さないよう、メニューシートだけ高さの上限を広げる */
#menuSheet {
  max-height: calc(100dvh - 92px);
}

/* =========================================================
   ホーム
   ========================================================= */

.home {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) clamp(16px, 4vw, 28px) 60px;
}

.fresh-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.fresh-badge.stale {
  color: var(--rose);
  border-color: var(--rose);
}

/* 「あなたのコンテキスト」を即表示したまま裏で最新化している時の、控えめな更新中インジケータ */
.unified-updating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.unified-updating .thinking-dots { gap: 3px; }
.unified-updating .thinking-dots span {
  width: 5px;
  height: 5px;
  background: var(--accent-ink);
}

.link-button {
  margin-top: 10px;
  padding: 4px 2px;
  background: none;
  border: 0;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.imported-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.imported-list:not(:empty) {
  margin-top: 12px;
}

.imported-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-ink);
}

.imported-chip button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
}

.imported-chip button:hover {
  color: var(--rose);
}

/* メニュー内の「読み込み済み」表示（読み込めた確認になる・常時残る） */
.menu-imported {
  margin: 2px 0 6px;
  padding: 12px 6px 4px;
  border-top: 1px solid var(--line);
}

.menu-imported-head {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* メニューの「あなたのこと（取り込み済み）」＝ファイル名でなく中身を見せる */
.profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.profile-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: baseline;
}

.profile-row-k {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: 0.02em;
}

.profile-row-v {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.profile-clear {
  margin-top: 12px;
  padding: 2px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.profile-clear:hover {
  color: var(--rose);
  border-bottom-color: var(--rose);
}

/* =========================================================
   チャット画面
   ========================================================= */

.chat-screen {
  position: relative;
  height: 100%;
  width: min(var(--shell-max), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr); /* 行を全高に＝.chat-main が高さ一杯になる（% に依存しない） */
  padding: 0 clamp(0px, 2vw, 20px);
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

/* モバイル（2カラムが無い幅）はチャット画面を flex 縦並びにして .chat-main を確実に高さ充填。
   grid の行stretch依存をやめる＝iPhone(WebKit)でも下端の入力欄が確実に最下部に来る。デスクトップは下の @media で2カラムgrid。 */
@media (max-width: 899px) {
  .chat-screen {
    display: flex;
    flex-direction: column;
  }
  .chat-main {
    flex: 1 1 auto;
  }
}

/* チャット上部の「いま：◯◯」場面バー */
.chat-spacebar {
  flex: none;
  padding: 6px clamp(12px, 3vw, 18px) 2px;
}

.chat-spacebar:empty {
  display: none;
}

/* どの私・どの問いの立て方か（作成時固定・編集不可）。それとなく見えて目立たない＝薄く小さく。タップで意味を開く。 */
/* 上部の左側。spacebar 撤去によりこれが最上段＝上余白を持たせる。右の「見えてきたこと」チップ(absolute)と重ならないよう幅を制限。 */
.chat-meta { flex: none; padding: 3px clamp(12px, 3vw, 18px) 2px; } /* 上を詰めて2段メタの中央線を右の「見えてきたこと」チップに合わせる（作者FB） */
.chat-meta[hidden] { display: none; }
.chat-meta-btn {
  display: inline-flex; align-items: flex-start; gap: 6px; max-width: 60%;
  background: none; border: 0; padding: 2px 2px; cursor: pointer;
  line-height: 1.35; color: var(--ink-faint); letter-spacing: .02em; text-align: left;
}
.chat-meta-lines { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-meta-role { font-weight: 600; color: var(--ink-soft); font-size: 12.5px; } /* 1段目＝この私 */
.chat-meta-mode { align-self: flex-start; font-size: 11px; color: var(--ink-faint); border-bottom: 1px dotted var(--line-strong); padding-bottom: 1px; } /* 2段目＝立て方（タップの手がかり） */
.chat-meta-info { margin-top: 1px; }
.chat-meta-sep { opacity: .45; }
.chat-meta-info {
  flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px;
  border: 1px solid var(--line-strong); border-radius: 50%; font-size: 9px; font-style: italic; color: var(--ink-faint);
}
.chat-meta-note {
  margin: 6px 2px 2px; padding: 11px 13px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.75; color: var(--ink-soft);
}
.chat-meta-note[hidden] { display: none; }
.chat-meta-note p { margin: 0 0 7px; }
.chat-meta-note p:last-child { margin-bottom: 0; }
.chat-meta-note strong { color: var(--ink); font-weight: 600; }
.chat-meta-fix { color: var(--ink-faint); font-size: 11.5px; }

.spacebar-details {
  position: relative;
  display: inline-block;
}

.spacebar-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
}

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

.spacebar-now {
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 700;
}

.spacebar-summary strong {
  color: var(--accent-ink);
  font-weight: 800;
}

.spacebar-caret {
  color: var(--ink-faint);
  font-size: 11px;
}

/* 切替先が無い時の静的ラベル（プルダウンでなく「いま：◯◯」だけ）。見た目は同じピル・操作不可。 */
.spacebar-static {
  cursor: default;
}
.spacebar-static strong {
  color: var(--accent-ink);
  font-weight: 800;
}

.spacebar-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 6;
  min-width: 200px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

.space-switch-item {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.space-switch-item:hover {
  background: var(--surface-2);
}

.space-switch-item.add {
  color: var(--accent-ink);
  border-top: 1px solid var(--line);
  margin-top: 2px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}

/* 日記の上部バー：左「‹ とじる」＋右「いまの私」セレクタ（この日記のコンテキストをどの私に貯めるか）。 */
.journal-rolebar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px clamp(12px, 3vw, 18px) 4px;
}
.journal-rolebar[hidden] {
  display: none;
}
.journal-close {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
}
.journal-close:hover {
  color: var(--accent-ink);
}
.journal-role-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 13.5px;
}
.journal-role-btn strong {
  color: var(--accent-ink);
  font-weight: 800;
}

/* 日記ふりかえりの「どの私」フィルター（横スクロールのチップ列・選択は控えめ強調）。 */
.journal-filter {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 14px;
  scrollbar-width: none;
}
.journal-filter::-webkit-scrollbar {
  display: none;
}
.journal-filter-chip {
  flex: none;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.journal-filter-chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* 日記ふりかえりのキーワード検索窓。 */
.journal-search {
  padding: 2px 0 10px;
}
.journal-search-input {
  width: 100%;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.journal-search-input::placeholder {
  color: var(--ink-faint);
}
/* 検索一致のハイライト（本文抜粋の中）。控えめな accent-soft。 */
mark.search-hit {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 3px;
  padding: 0 1px;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 24px) 8px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.bubble {
  max-width: 100%;
  line-height: 1.62;
  white-space: pre-line;
  animation: bubble-in 0.26s var(--ease);
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bubble.ai {
  align-self: flex-start;
  max-width: 32ch;
  padding: 2px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink);
}

/* 禅：AIの問いの前に、静かなアクセントの一線を引く */
.bubble.ai::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.65;
}

.bubble.user {
  align-self: flex-end;
  max-width: 28ch;
  padding: 2px 14px 2px 0;
  text-align: right;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-right: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.7;
}

/* 日記の各記述（ふりかえりで編集できる）。user bubble に合わせて右寄せ。 */
.journal-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.journal-entry-edit {
  margin: 2px 14px 0 0; /* 右端を user bubble の padding-right(14px) に合わせる */
  background: transparent;
  border: none;
  color: var(--ink-faint);
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 2px;
}
.journal-entry-edit:hover {
  color: var(--accent-ink);
}
.journal-entry.editing {
  align-items: stretch; /* 編集中はテキストエリアを全幅に */
}
.journal-edit {
  width: 100%;
}
.inline-actions .journal-edit-del {
  margin-right: auto; /* 削除は左へ（取消／保存は右） */
}

.bubble-reply {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
}

.bubble-question {
  margin: 0;
  font-size: 19px;
  line-height: 1.72;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.bubble.thinking {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 4px 0;
}

/* 思考中バブルにはアクセント線を出さない */
.bubble.ai.thinking::before {
  display: none;
}

.thinking-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: blink 1.3s infinite both;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

.thinking-text {
  color: var(--ink-soft);
  font-size: 13.5px;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* 入力ゾーン（下部固定） */
.composer-zone {
  flex: none;
  /* 下端の余白：ホームインジケーター分(safe-area)＋少し。safe-area が 0 を返す環境（ホームボタン機・Safari）でも
     最低8pxは確保しつつ、空きすぎないよう詰める（旧 max(...,20)+14=34px → max(...,8)+6=14px）。 */
  padding: 8px clamp(12px, 3vw, 18px) calc(max(env(safe-area-inset-bottom), 8px) + 6px);
  background: transparent;
}

/* 入力中に「いま答えている問い」を入力欄の真上にピン留め（キーボードで上部が隠れても読める）。 */
.composer-question {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.composer-question[hidden] {
  display: none;
}
.composer-question-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}
.composer-question-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  /* 長い問いは3行で省略（入力の邪魔をしない）。多くの問いは1〜2文で収まる。 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quick-replies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 4択を2列×2行に収める（縦に積んで問いが押し出されるのを防ぐ） */
  align-items: stretch;
  width: 100%;
  gap: 7px;
  margin-bottom: 10px;
}

.quick-replies:empty {
  margin: 0;
}

/* 2列に収めるぶん、選択肢は少し小さく・センター寄せ・2行まで折返し可 */
.quick-replies .chip {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  padding: 7px 8px;
  text-align: center;
  line-height: 1.28;
  box-sizing: border-box;
  white-space: normal;
  overflow: hidden;
}

/* チップ内の文字だけを最大2行に閉じ込める。長い候補はJSで tight/tiny を付けて縮小する。 */
.quick-replies .chip-text {
  min-width: 0;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.quick-replies .chip.tight .chip-text {
  font-size: 11.5px;
}

.quick-replies .chip.tiny .chip-text {
  font-size: 10.5px;
  line-height: 1.22;
}

/* 言語化ヘルプ（「うまく言えない」→候補）もiPhone SEでは最大2段に収める。 */
.quick-replies.suggest {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quick-replies.suggest .chip {
  text-align: center;
  justify-self: stretch;
}
/* 入力欄に写した候補だけ、枠色で静かに示す */
.quick-replies.suggest .chip.picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  transition: transform 0.14s var(--ease), background 0.14s var(--ease), border-color 0.14s var(--ease);
  animation: bubble-in 0.2s var(--ease);
}

.chip:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.chip:active {
  transform: translateY(0);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 6px 6px 6px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s var(--ease);
}

.composer:focus-within {
  border-color: var(--accent);
}

.composer-input {
  flex: 1;
  min-height: 36px;
  max-height: 168px;
  padding: 8px 6px 8px 8px;
  border: 0;
  background: transparent;
  resize: none;
  line-height: 1.5;
  font-size: 16px; /* iOSのズーム防止 */
}

.composer-input:focus {
  outline: none;
}

.composer-input::placeholder {
  color: var(--ink-faint);
}

.send-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s var(--ease), background 0.14s var(--ease);
}

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

.send-button:active {
  transform: scale(0.94);
}

/* 日記の送信ボタンは丸アイコンでなく「残す」テキストの濃ピル（新デザイン）。 */
.send-button--text {
  width: auto;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent-ink);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
}
.send-button--text:hover {
  background: var(--accent-press);
}

/* 音声入力ボタン：送信（塗りaccent）と差をつけた控えめな丸。非対応ブラウザではJSで隠す */
.mic-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  transition: transform 0.14s var(--ease), background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.mic-button[hidden] { display: none; } /* hidden を display:grid より優先（非対応時は出さない） */
.mic-button:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}
.mic-button:active { transform: scale(0.94); }
/* 録音中：accentで満たし、やさしく明滅（警告色の赤は使わない＝禅トーン） */
.mic-button.recording {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  animation: micPulse 1.25s var(--ease) infinite;
}
@keyframes micPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.composer-helpers {
  display: flex;
  gap: 22px;
  margin-top: 11px;
  justify-content: center;
}

/* 禅：対話の逃げ道（うまく言えない/とばす）は、控えめなテキストリンクに */
.composer-helpers .ghost-button {
  min-height: auto;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

.composer-helpers .ghost-button:hover {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  border-bottom-color: var(--line-strong);
}

/* 禅：チャット内に常設する「終わる出口」。控えめだが、いつでも見える位置に。 */
.finish-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 4px; /* 「うまく言えない/質問を変える」との間を詰める（旧12px・作者FB） */
}

.finish-row[hidden] {
  display: none;
}

.finish-link {
  min-height: auto;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease), background 0.14s var(--ease), transform 0.14s var(--ease);
}

.finish-link[hidden] {
  display: none;
}

.finish-link:hover {
  color: var(--ink-soft);
  border-bottom-color: var(--line-strong);
}

/* 2-5 受け身で終われる安心：「保存して終わる」を初回から少し見やすく（控えめな常設アンダーライン＋ink-soft）。 */
.finish-link.pause {
  color: var(--ink-soft);
  border-bottom-color: var(--line);
}

/* 「ここまでをまとめる」＝十分話せた時に加わる主アクション。淡いピルで少しだけ存在感を持たせる。 */
.finish-link.summarize {
  padding: 7px 17px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  border-bottom: 0;
}

.finish-link.summarize:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom: 0;
  transform: translateY(-1px);
}

/* 日記の「深掘りの問いをもらう」：淡いピル（◎アイコン付き）。 */
.finish-link.deepen-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  border-bottom: 0;
}
.finish-link.deepen-pill:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom: 0;
  transform: translateY(-1px);
}
.deepen-pill-icon {
  font-size: 13px;
  line-height: 1;
}

/* 日記の日付見出し（チャットログ冒頭）。 */
.journal-date {
  margin: 0 0 4px;
  align-self: flex-start;
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- 初回TTV：最初の数分で「もう渡せる」を見せる控えめなカード ---------- */
.first-value {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: fvIn 0.3s var(--ease);
}
.first-value[hidden] { display: none; }
@keyframes fvIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
/* 右上の×＝「閉じる（=ただ非表示）」。続けたい時は上の対話を打てばよい。 */
.fv-close {
  position: absolute;
  top: 7px;
  right: 9px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 19px;
  line-height: 1;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}
.fv-close:hover { color: var(--ink-soft); background: var(--surface-2); }
.fv-title { margin: 0 28px 8px 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.fv-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.fv-list li { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; }
.fv-k { flex: none; min-width: 6em; color: var(--ink-faint); }
.fv-v { min-width: 0; color: var(--ink-soft); }
.fv-note { margin: 0 0 12px; font-size: 12px; line-height: 1.55; color: var(--ink-faint); }
/* 既定は1つの主ボタン。押すと下の選択（fv-choices）に切り替わる＝選択は“貼ると決めてから”出す。 */
.fv-primary { width: 100%; min-height: 44px; border-radius: 12px; font-size: 14px; }
.fv-choices { animation: fvIn 0.2s var(--ease); }
.fv-choices[hidden] { display: none; }
.fv-choices-label { margin: 0 0 8px; font-size: 12px; color: var(--ink-faint); text-align: center; }
.fv-actions { display: flex; gap: 8px; }
.fv-ai { min-height: 40px; border-radius: 12px; font-size: 13px; }

/* 受け取りカード（対話を締めた後の「使う」導線）。容器は .first-value、中身は .fv-* を流用。
   下の控えめな二次行（コピー／しっかりまとめる）だけ専用。 */
.cv-more { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }
.cv-link {
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 12.5px;
  padding: 4px 2px;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.cv-link:hover { color: var(--ink-soft); border-bottom-color: var(--line-strong); }

/* 矛盾/更新の検知バー：会話を邪魔せず、チャット下部に小さく・控えめに。 */
.update-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  animation: fvIn 0.3s var(--ease);
}
.update-notice[hidden] { display: none; }
.update-notice-text {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.update-notice-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
}
.update-notice-actions { display: flex; gap: 8px; }
.update-notice-btn {
  flex: 1;
  min-height: 34px;
  border-radius: 9px;
  font-size: 12.5px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.update-notice-btn.apply {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.update-notice-btn:hover { border-color: var(--ink-faint); }
.update-notice-btn.apply:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- ホーム：あなたのコンテキストへの導線 ---------- */
/* 小さな中央寄せピルにして周囲に溶け込ませる（横長カードをやめる・地は透明・影なし） */
.entry-you:empty { display: none; }
/* 上部の導線（あなたのコンテキスト／相談を磨く）を縦に積む。中央寄せ・小さめの間隔 */
.entry-you { margin: 0 auto 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.home-you {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  padding: 7px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
  text-align: left;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease);
}
.home-you:hover { border-color: var(--line-strong); background: var(--surface); }
.home-you.ghost { border-style: dashed; }
.home-you-main { min-width: 0; display: inline-flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.home-you-label { font-weight: 600; color: var(--ink); font-size: 13px; }
.home-you-desc { font-size: 11.5px; color: var(--ink-faint); }
.home-you-chev { color: var(--ink-faint); font-size: 16px; align-self: center; }

/* ---------- あなたのコンテキスト（統合画面） ---------- */
.unified-screen {
  width: min(var(--shell-max, 560px), 100%);
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 28px) calc(env(safe-area-inset-bottom) + 32px);
}
.unified-head { padding: 6px 0 14px; }
.unified-head .link-button { padding: 4px 0; color: var(--ink-soft); }
.unified-title { font-size: 24px; line-height: 1.35; color: var(--ink); margin: 6px 0 8px; }
.unified-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.unified-status { color: var(--ink-soft); padding: 28px 4px 4px; text-align: center; }
/* 統合中の「動いてる感」：カテゴリが順に灯る段階表示＋見通し（CSSのみ・実進捗ではなく演出）。 */
.unified-progress { padding: 6px 0 20px; }
.mc-wait {
  display: grid;
  justify-items: center;
  gap: 13px;
  padding: 18px 10px 14px;
  text-align: center;
}
.mc-wait-water {
  position: relative;
  width: 118px;
  height: 74px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
}
.mc-wait-ring {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ripple-ring);
  border-radius: 50%;
  opacity: 0;
  animation: waitRipple 3.6s var(--ease) infinite;
}
.mc-wait-ring.r2 { animation-delay: 1.15s; }
.mc-wait-ring.r3 { animation-delay: 2.3s; }
.mc-wait-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ripple-core);
  opacity: 0.72;
  box-shadow: 0 0 18px var(--accent-soft);
}
@keyframes waitRipple {
  0% { opacity: 0.58; transform: scale(0.3); }
  72% { opacity: 0.1; transform: scale(5.1); }
  100% { opacity: 0; transform: scale(5.8); }
}
.mc-wait-copy {
  display: grid;
  gap: 5px;
  max-width: 36ch;
}
.mc-wait-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.mc-wait-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
}
.mc-wait-eta,
.mc-wait-note {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.65;
}
.context-float-layer {
  position: fixed;
  inset: 0;
  z-index: 86;
  pointer-events: none;
}
.context-float-scrim {
  position: absolute;
  inset: 0;
  background: rgba(90, 117, 133, 0.055);
}
.context-float-layer.is-running .context-float-scrim {
  background: rgba(90, 117, 133, 0.07);
}
.context-float-layer.is-busy .context-float-scrim {
  background: rgba(90, 117, 133, 0.055);
}
.context-ripple-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.context-ripple-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(104px, 24vmin, 172px);
  height: clamp(104px, 24vmin, 172px);
  border: 1px solid rgba(90, 117, 133, 0.24);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.12);
  animation: contextFullRipple 9.8s ease-out infinite;
  animation-delay: var(--ripple-delay, 0s);
}
.context-ripple-ring.r2 { --ripple-delay: 1.95s; }
.context-ripple-ring.r3 { --ripple-delay: 3.9s; }
.context-ripple-ring.r4 { --ripple-delay: 5.85s; }
.context-ripple-ring.r5 { --ripple-delay: 7.8s; }
@keyframes contextFullRipple {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.12); }
  10% { opacity: 0.23; }
  72% { opacity: 0.07; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(8.8); }
}
.context-float-card {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 82px);
  width: min(520px, calc(100vw - 32px));
  max-height: min(46vh, 380px);
  overflow: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(35, 40, 44, 0.13);
  border-radius: var(--r-md);
  background: rgba(247, 249, 250, 0.88);
  box-shadow: 0 12px 34px rgba(35, 40, 44, 0.12);
  color: var(--ink-soft);
}
.context-float-card-prompt {
  display: grid;
  gap: 8px;
  padding: 15px 17px 17px;
  pointer-events: auto;
}
.context-float-card-running,
.context-float-card-busy {
  background: rgba(247, 249, 250, 0.68);
  border-color: rgba(35, 40, 44, 0.10);
  box-shadow: 0 10px 28px rgba(35, 40, 44, 0.09);
  pointer-events: none;
}
.context-float-card-busy {
  padding: 14px 16px;
  text-align: center;
}
.context-float-running-copy,
.context-float-busy-copy {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 138px);
  width: min(430px, calc(100vw - 42px));
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 10px 14px 11px;
  border: 1px solid rgba(35, 40, 44, 0.08);
  border-radius: var(--r-sm);
  background: rgba(247, 249, 250, 0.66);
  box-shadow: 0 10px 26px rgba(35, 40, 44, 0.08);
  text-align: center;
  pointer-events: none;
  color: var(--ink-soft);
}
.context-float-card-running .mc-wait {
  padding: 14px 10px 12px;
}
.context-float-card-running .mc-wait-water {
  width: 132px;
  height: 80px;
  opacity: 0.78;
}
.context-float-card-running .mc-wait-copy {
  max-width: 34ch;
}
.context-float-title,
.context-float-body,
.context-float-note {
  margin: 0;
}
.context-float-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}
.context-float-body {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}
.context-float-note {
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.75;
}
.context-float-action {
  margin-top: 3px;
}
body.context-screen[data-ctx-tone="night"] .context-float-scrim {
  background: rgba(126, 164, 182, 0.08);
}
body.context-screen[data-ctx-tone="night"] .context-float-layer.is-running .context-float-scrim {
  background: rgba(126, 164, 182, 0.10);
}
body.context-screen[data-ctx-tone="night"] .context-ripple-ring {
  border-color: rgba(185, 210, 220, 0.24);
}
body.context-screen[data-ctx-tone="night"] .context-float-running-copy,
body.context-screen[data-ctx-tone="night"] .context-float-busy-copy {
  border-color: rgba(207, 216, 220, 0.12);
  background: rgba(24, 34, 40, 0.58);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
body.context-screen[data-ctx-tone="night"] .context-float-card {
  border-color: rgba(207, 216, 220, 0.18);
  background: rgba(28, 37, 43, 0.76);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}
body.context-screen[data-ctx-tone="night"] .context-float-card-running,
body.context-screen[data-ctx-tone="night"] .context-float-card-busy {
  background: rgba(28, 37, 43, 0.56);
}
@media (max-width: 520px) {
  .context-float-card {
    bottom: calc(env(safe-area-inset-bottom) + 70px);
    width: calc(100vw - 28px);
  }
  .context-float-running-copy,
  .context-float-busy-copy {
    bottom: calc(env(safe-area-inset-bottom) + 122px);
    width: calc(100vw - 34px);
  }
}
.unified-busy-note,
.unified-manual-update {
  margin: 10px 0 14px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}
.unified-busy-note {
  text-align: center;
}
.unified-manual-update {
  display: grid;
  gap: 9px;
}
.unified-manual-update p {
  margin: 0;
}
.unified-manual-update strong {
  color: var(--ink);
}
.unified-manual-update .primary-button {
  margin-top: 2px;
}
.unify-steps { list-style: none; margin: 16px auto; padding: 0; display: flex; flex-direction: column; gap: 7px; width: max-content; max-width: 100%; }
.unify-steps li { font-size: 14px; color: var(--ink-faint); opacity: 0.3; animation: unifyStep 3.6s ease-in-out infinite; }
.unify-steps li:nth-child(2) { animation-delay: 0.5s; }
.unify-steps li:nth-child(3) { animation-delay: 1s; }
.unify-steps li:nth-child(4) { animation-delay: 1.5s; }
.unify-steps li:nth-child(5) { animation-delay: 2s; }
.unify-steps li:nth-child(6) { animation-delay: 2.5s; }
@keyframes unifyStep { 0%, 100% { opacity: 0.3; } 12% { opacity: 1; color: var(--accent-ink); } 32% { opacity: 0.55; color: var(--ink-faint); } }
.unify-eta { text-align: center; font-size: 12px; color: var(--ink-faint); margin-top: 8px; }
.unified-empty { padding: 16px 0; }
.unified-empty-lead { font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.unified-empty .primary-button { margin-top: 14px; }

/* 「あなたのコンテキスト」の私(役割)セレクタ。横スクロールのチップ行（相談の人格チップを流用）。 */
.unified-roles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  /* ★スクロールしても画面上に張り付く（作者FB）。スクロール容器は .main（#app）＝親階層に overflow制限が無いので機能する。
     下のカードと重ならないよう不透明な背景を付ける。z-indexは固定通知バー(#sortBar:80)より下、カード(0)より上で控えめに。 */
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 6px 0 8px;
}
/* 夜トーンの放射グラデーションに馴染ませる：フラットな地色帯が浮くのを防ぎ、すりガラスで背景を透かす。
   backdrop-filter 非対応ブラウザは上の不透明 var(--bg) にフォールバック。 */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .unified-roles {
    background: transparent;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}
.unified-roles-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
}
.unified-roles-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.unified-roles-chips .persona-chip {
  flex: none; /* 横スクロールで全部見せる（折り返さない） */
}

/* 「全部のあなた」一望ビューの、私ごとのセクション見出し */
.unified-allsec + .unified-allsec {
  margin-top: 20px;
}
.unified-allsec-head {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-ink);
}

/* 「別の私へ移す（一文ずつ）」：各一文＋移し先チップ */
.unified-move {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.move-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.move-line-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}
.move-line-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.move-target {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
}
.move-target:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* 取り込み中の通知バー（画面下に固定）。processing=控えめのグレー／ready=accentで「準備ができました」。
   位置はsafe-area考慮で下端から余白を取る。チャットのcomposer上にも被らないよう、上に少し浮かせる。 */
.sort-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px); /* composer(下端入力欄)より上に出す */
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.sort-bar[data-state="ready"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.sort-bar[data-state="ready"]:hover { filter: brightness(1.02); }
.sort-bar-text { display: inline-flex; align-items: center; gap: 8px; }

/* 取り込んだメモの振り分け画面（#sort）。move系と同じトーンで、まとめて／種類ごと／一文ごとに各私へ。 */
.sort-section { margin: 0 0 22px; }
.sort-section-head { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.sort-section-sub { display: block; font-size: 11px; font-weight: 400; color: var(--ink-faint); margin-top: 3px; }
.sort-target-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sort-target {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
}
.sort-target:hover { background: var(--accent-soft); border-color: var(--accent); }
.sort-target-strong { background: var(--accent-soft); border-color: var(--accent); } /* 「全部まとめて」は塗りで強調 */
/* 「× 捨てる」＝控えめなグレー塗り（このアプリの世界観に馴染ませる）。
   作者FB「白地に赤は浮く」→ surface-2の塗り＋通常のink文字に。色味で目立たせず、形（×）と文言で識別する。 */
.sort-delete { color: var(--ink); background: var(--surface-2); border-color: var(--line); }
.sort-delete:hover { background: var(--line); border-color: var(--line-strong); color: var(--ink); }
.sort-cat { margin: 0 0 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.sort-cat-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sort-cat-label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.sort-cat-whole { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sort-cat-whole-label { font-size: 11.5px; color: var(--ink-faint); }
.sort-lines { display: flex; flex-direction: column; gap: 8px; }
.sort-line { display: flex; flex-direction: column; gap: 6px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.sort-line-text { font-size: 13px; color: var(--ink); line-height: 1.5; }
.sort-line-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.sort-skip { margin-top: 6px; }

/* 振り分け改善：元に戻すバー／初心者向け説明／新しい私を作る */
.sort-undo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 16px; padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--line);
}
.sort-undo-label { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; min-width: 0; }
.sort-undo-btn {
  flex: none; padding: 7px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--accent-ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.sort-undo-btn:hover { border-color: var(--accent); }
.sort-intro {
  margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.sort-intro-h { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.sort-intro-b { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--ink-soft); }
.sort-intro-b b { color: var(--ink); font-weight: 600; }
.sort-create {
  display: inline-flex; align-items: center; margin: 0 0 18px; padding: 9px 18px;
  border-radius: 999px; background: transparent; border: 1px dashed var(--accent);
  color: var(--accent-ink); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .12s ease;
}
.sort-create:hover { background: var(--accent-soft); }

/* 「選んでから決定」：選んだ行き先チップをハイライト／行き先が決まった一文はそっと印 */
.sort-target.is-picked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.sort-target.sort-delete.is-picked { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--surface); }
.sort-line.is-set { opacity: .96; }
.sort-line.is-set .sort-line-text::after { content: " ✓"; color: var(--accent-ink); font-weight: 700; }
/* 下に固定の「決定」バー。#sortBody はこのぶん下に余白を取る（.sort-bottom-space）。 */
.sort-bottom-space { height: 76px; }
.sort-commit {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px clamp(14px, 4vw, 22px) calc(env(safe-area-inset-bottom) + 10px);
  background: transparent;
  display: flex; justify-content: center;
}
.sort-commit[hidden] { display: none; }
.sort-commit-btn {
  width: min(560px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 12px 20px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
  font-size: 15px; font-weight: 600;
}
.sort-commit[data-state="ready"] .sort-commit-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sort-commit[data-state="incomplete"] .sort-commit-btn { background: var(--surface); color: var(--ink-soft); }
.sort-commit-count { font-size: 14px; }
.sort-commit-go { font-size: 13.5px; opacity: .92; }
.sort-commit[data-state="incomplete"] .sort-commit-go { color: var(--ink-faint); }

.unified-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
/* 固めない（無常性）の問い直し。警告色(rose)でなく穏やかなaccentで「変わっていい」を誘う。 */
.unified-reask {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  line-height: 1.55;
}
.unified-cards { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
/* 役割表示の下に添える「共通のあなた」セクション（コピーに付く共通項目を、ここでオン/オフできる） */
.unified-common-attach { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.unified-common-head { margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.unified-common-sub { display: block; font-size: 11px; font-weight: 400; color: var(--ink-faint); margin-top: 3px; }
.unified-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: opacity 0.18s var(--ease);
}
.unified-card.off { opacity: 0.5; }
/* カードの折りたたみ（既定たたみ＝冒頭プレビュー／見出しタップで全開） */
.unified-card-headmain.foldable {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
}
/* 「続きを見る」＝見切れている下端（カード末尾）に控えめなシェブロン（⌄＝開く／⌃＝閉じる）。タイトル横の▼より自然。 */
.unified-foldmore {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1;
  padding: 8px 0 3px;
  margin-top: 2px;
  text-align: center;
}
.unified-foldmore:hover { color: var(--ink-soft); }
.unified-card:not(.has-more) .unified-foldmore { display: none; } /* 冒頭で全部見えるカードは続きの印を出さない */
.unified-card:not(.has-more) .unified-card-headmain.foldable { cursor: default; } /* たためないカードはポインタにしない */
.unified-cardbody.clamped { position: relative; max-height: 72px; overflow: hidden; }
.unified-card.has-more .unified-cardbody.clamped::after { /* たたみ中、まだ下に続く合図のフェード */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}
.unified-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.unified-card-label { font-weight: 600; color: var(--ink); }
.unified-card-hint { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
/* ⑥ 種類ごとの最終更新日（その種類の下に小さく）。長く更新されていない種類に気づけるように */
.unified-card-date { flex-basis: 100%; font-size: 10.5px; font-weight: 600; color: var(--ink-faint); margin-top: 3px; }
.unified-text { color: var(--ink); line-height: 1.7; font-size: 14.5px; }
/* 文字列カテゴリの「一文ごと箇条書き」表示（和文の「・」＋ぶら下げインデント） */
.unified-bullets { margin: 0; padding: 0; list-style: none; }
.unified-bullets li { color: var(--ink); font-size: 14.5px; line-height: 1.6; padding-left: 1.2em; text-indent: -1.2em; }
.unified-bullets li + li { margin-top: 5px; }
.unified-bullets li::before { content: "・"; color: var(--ink-faint); }
.unified-words { display: flex; flex-direction: column; gap: 4px; }
.unified-word { color: var(--ink); font-size: 15px; }

/* カード見出し・編集 */
.unified-card-headmain { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.unified-card-tools { display: flex; align-items: center; gap: 10px; flex: none; }
/* 段階開示：編集/深掘りは「⋯」に畳む（初期表示は内容＋on/off＋貼るCTAを主役に）。 */
.unified-more { background: transparent; border: 0; color: var(--ink-faint); font-size: 18px; line-height: 1; padding: 2px 9px; border-radius: 8px; letter-spacing: 1px; }
.unified-more:hover { color: var(--ink-soft); background: var(--surface-2); }
.unified-card.editing { border-color: var(--accent); }
.unified-edit {
  width: 100%; margin-top: 4px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 15px;
  resize: vertical; min-height: 96px; font-family: inherit;
}
.unified-edit:focus { outline: none; border-color: var(--accent); }
.unified-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.unified-edit-choice { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* オン/オフ スイッチ（ピル型） */
.unified-toggle {
  position: relative;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--line-strong);
  border: 0;
  flex: none;
  cursor: pointer;
  transition: background 0.18s var(--ease);
}
.unified-toggle.on { background: var(--accent); }
.unified-toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease);
}
.unified-toggle.on .unified-toggle-knob { transform: translateX(18px); }

/* 追尾CTA：画面下に貼り付く（縦に長い画面でも、一番下までスクロールせずコピー/相談できる） */
.unified-cta {
  position: sticky;
  bottom: 0;
  margin: 18px calc(-1 * clamp(16px, 4vw, 28px)) 0;
  padding: 12px clamp(16px, 4vw, 28px) calc(env(safe-area-inset-bottom) + 12px);
  background: transparent;
}
.unified-cta-label { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin-bottom: 8px; }
.unified-cta-count { color: var(--ink-faint); }
.unified-cta-count::before { content: "・"; margin: 0 6px; color: var(--ink-faint); }
.unified-cta-row { display: flex; gap: 8px; }
.cta-ai {
  flex: 1;
  min-height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s var(--ease), background 0.14s var(--ease);
  /* <a> でも <button> でも同じ見た目に（外部AIは本物のリンクで開く＝モバイルで確実）。 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.cta-ai:hover { background: var(--accent-press); transform: translateY(-1px); }
.cta-ai:active { transform: scale(0.97); }

/* ===== あなたのコンテキスト：夜／霧トーン（このページにいる間だけ・他画面は従来の霧のまま） =====
   route() が #context で body に .context-screen を付け、data-ctx-tone（mc_tone・既定=夜）を反映する。
   既存の .unified-* は --ink 等のトークンを使うので、ここでトークンを上書きするだけで色が切り替わる（配線は不要）。
   ※ V1デザイン（Claude Design確定版）の実験：まずこのページだけ。良ければ全体へ。 */
body.context-screen[data-ctx-tone="night"] {
  color-scheme: dark;
  --bg: #1b2228; --bg2: #1c252b;
  --surface: rgba(207, 216, 220, 0.06); --surface-2: rgba(207, 216, 220, 0.10); --surface-3: rgba(207, 216, 220, 0.16);
  --ink: #cfd8dc; --ink-soft: #90a0a8; --ink-faint: #62707a;
  --line: rgba(207, 216, 220, 0.14); --line-strong: rgba(207, 216, 220, 0.24);
  --accent: #9bb6c4; --accent-press: #86a6b6; --accent-ink: #c2d4dc; --accent-soft: rgba(150, 180, 195, 0.16); --on-accent: #16202a;
  --cta-consult-bg: #86a2af; /* 相談ボタンの強調を少し和らげた色（夜トーンだけ・暗背景で明る過ぎないように） */
  --sand: transparent; --ripple-ring: rgba(150, 180, 195, 0.5); --ripple-core: rgba(185, 210, 220, 0.9);
}
body.context-screen[data-ctx-tone="night"] {
  background:
    radial-gradient(120% 90% at 70% 8%, #28333b, transparent 60%),
    radial-gradient(120% 90% at 8% 100%, #1c252b, transparent 55%),
    #1b2228;
}
/* コンテキスト画面の生きた背景：夜・霧どちらのトーンでもキャンバスを表示し、
   ambient.js がトーンに応じたパレット（yoru / kiri）で描く。
   ※かつて霧トーンだけ非表示にしていた（「水面ヒーローと波紋が3重でごちゃつく」作者FB 2026-07-02・z317）が、
     作者FB 2026-07-04（z351）で「霧でも背景アニメーションを有効に」へ方針変更＝display:none ルールを撤去。
     戻したくなったら body.context-screen[data-ctx-tone="mist"]:not(.ambient-zen) #ambientCanvas { display:none } を復活させる。 */
/* 霧トーンは body.ambient-on が background:none にしているため、素の霧グラデ（bodyの既定背景）をここで復元する。
   キャンバスの下敷き＝ambient停止・一時停止時やキャンバス透過部分の保険として残す。
   ★[data-ctx-tone="mist"] に限定＝夜トーンの暗背景ルール（このすぐ上・詳細度0,2,1）を誤って上書きしない。 */
body.ambient-on.context-screen[data-ctx-tone="mist"] {
  background:
    radial-gradient(120% 80% at 85% -10%, var(--bg-grad-1), transparent 60%),
    radial-gradient(120% 90% at -10% 110%, var(--bg-grad-2), transparent 55%),
    var(--bg);
}
/* ヘッダー上段：もどる（左）＋トーン切替（右） */
.unified-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctx-tone-tg {
  flex: none; font-size: 11px; color: var(--ink-faint);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.ctx-tone-tg:hover { border-color: var(--line-strong); color: var(--ink-soft); }

/* ===== V1：俯瞰ヒーロー（水面）＋まとめ文章＋凡例（夜/霧どちらのトークンでも映える） ===== */
/* 各カテゴリ（中身あり）を固定位置の同心円＝星に。本質の一文＋鮮度で濃淡。揺れ(open)は強調。glow不使用。 */
.unified-sky {
  position: relative; height: 384px; overflow: hidden;
  margin: 8px calc(-1 * clamp(16px, 4vw, 24px)) 0; /* 枠なし・全幅ブリード（左右の画面余白を相殺） */
}
/* ② 波紋＝同心円。文字（.unified-star）と同じ％位置・中心ぞろえで重ねるCSS円（旧SVGの座標ズレを解消）。 */
.unified-ring { position: absolute; transform: translate(-50%, -50%); border: 1px solid var(--ripple-ring); border-radius: 50%; pointer-events: none; }
.unified-star { position: absolute; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.unified-star .nm { font-size: 12px; font-weight: 600; color: var(--ink); }
.unified-star .es { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 10px; line-height: 1.4; color: var(--ink-soft); margin: 3px auto 0; max-width: 124px; overflow: hidden; }
.unified-star.faint .nm { color: var(--ink-soft); }
.unified-star.wave .nm { color: var(--accent-ink); }

.unified-summary { margin-top: 14px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.unified-summary-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.unified-summary-meta .muted { font-size: 11px; color: var(--ink-faint); }
/* ★z234：AIが essence で出力する \n\n（段落区切り）を可視化＝500字でも段組みで読める。
   pre-line は「連続空白は1つにまとめつつ改行は保持」。段落間は空行1つぶんの隙間が入る。 */
.unified-summary p { margin: 0; font-size: 15.5px; line-height: 1.95; color: var(--ink); white-space: pre-line; }
.unified-summary p + p { margin-top: 12px; } /* 2 つ目以降の段落（将来 </p><p> 分割するなら活用） */
/* まとめが行き止まりで作れなかった時の控えめな再生成導線（失敗の見える化）。 */
.unified-essence-stuck { padding: 4px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.9; }
.unified-essence-retry {
  display: inline-block; margin-left: 4px; padding: 4px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.unified-essence-retry:hover { background: var(--surface); border-color: var(--ink-faint); }
.unified-essence-retry:active { transform: translateY(0.5px); }

.unified-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 2px 0; }
.unified-legend span { font-size: 10.5px; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 5px; }
.unified-legend .k { width: 16px; height: 0; border-top: 2px solid var(--ripple-ring); }
.unified-legend .note { width: 100%; margin-top: 2px; }

.unified-alldiv { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink-faint); margin: 26px 2px 12px; display: flex; align-items: center; gap: 10px; }
.unified-alldiv::before, .unified-alldiv::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* V1：カード本文＝まとめ一文(cb-sum)＋続きの箇条書き(cb-full・畳み)。キャレットで開閉。 */
.unified-cb-sum { margin: 9px 0 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.unified-card.off .unified-cb-sum { color: var(--ink-soft); }
.unified-card.open-cat .unified-card-label { color: var(--accent-ink); }
.unified-cb-full { overflow: hidden; max-height: 0; transition: max-height 0.28s var(--ease); }
.unified-card.peek .unified-cb-full {
  max-height: 30px;
  -webkit-mask-image: linear-gradient(#000 0, #000 50%, transparent 100%);
  mask-image: linear-gradient(#000 0, #000 50%, transparent 100%);
}
.unified-card.open-cat .unified-cb-full { max-height: none; -webkit-mask-image: none; mask-image: none; }
.unified-v1-bullets { margin: 6px 0 0; padding: 0; list-style: none; }
.unified-v1-bullets li { position: relative; padding-left: 15px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); margin: 3px 0; }
.unified-v1-bullets li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--ripple-ring); }
.unified-v1-bullets li.mincho { font-family: var(--font-mincho); color: var(--ink); }
.unified-caret { display: block; margin: 4px auto 0; width: 40px; height: 20px; border: 0; background: transparent; color: var(--ink-faint); cursor: pointer; }
.unified-caret svg { transition: transform 0.2s var(--ease); }
.unified-card.open-cat .unified-caret svg { transform: rotate(180deg); }
/* 初日/空の状態：対話/日記への招待（採点しない・急かさない） */
.unified-empty-cta { display: flex; gap: 10px; margin-top: 14px; }
.unified-empty-cta .secondary-button { flex: 1; }
/* 「コピーだけする」は、塗りのAIボタンとは別アクションと分かるよう、独立したアウトラインボタンに */
.cta-copy {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.14s var(--ease), border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.cta-copy:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.cta-copy:active { transform: scale(0.98); }

/* ===== 主役＝相談デスクへ（あなたのコンテキストのCTA）。コピーで持ち出す経路は二番手として残す ===== */
/* 主役の相談ボタン＝塗りで大きく。これがいちばん目を引く（コピーは下に控えめに置く）。 */
.cta-consult {
  display: block;
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  /* 強調を少し和らげる（禅・落ち着き）。夜トーンは --cta-consult-bg で一段沈めた色に・影は外す。霧は白文字のコントラスト維持のため accent のまま。 */
  background: var(--cta-consult-bg, var(--accent));
  color: var(--on-accent);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.14s var(--ease), background 0.14s var(--ease);
}
.cta-consult:hover { background: var(--accent-press); transform: translateY(-1px); }
.cta-consult:active { transform: scale(0.98); }
.cta-consult-note { font-size: 11.5px; color: var(--ink-faint); text-align: center; margin: 6px 0 0; }
/* 二番手＝コピーで持ち出す（畳んで1ボタン。押すと各AI/「コピーだけする」が開く＝縦幅を取らない）。 */
.unified-cta-copyout { margin-top: 12px; }
/* 共有カード（夜空の俯瞰を画像でシェア）＝拡散の起点。コピーするより少しだけ目を引く accent トーンに。 */
.unified-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.14s var(--ease), background 0.14s var(--ease);
}
.unified-share-btn:hover { background: rgba(90, 117, 133, 0.18); }
.unified-share-btn:active { transform: scale(0.98); }
.unified-share-ico { font-size: 14px; line-height: 1; color: var(--accent); }
.unified-copy-toggle {
  display: block;
  width: 100%;
  min-height: 40px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.14s var(--ease), border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.unified-copy-toggle:hover { border-color: var(--accent); color: var(--ink); }
.unified-copy-toggle:active { transform: scale(0.98); }
.unified-copy-menu[hidden] { display: none; }
.unified-copy-toggle[hidden] { display: none; }
/* 開いた時の見出し行：左にオン数・右に小さく「閉じる」（コピーするボタンは消えてここに置き換わる）。 */
.unified-copy-menu-head { display: flex; align-items: center; justify-content: space-between; min-height: 18px; margin-bottom: 8px; }
.unified-copy-count { font-size: 11.5px; color: var(--ink-faint); }
.unified-copy-close { background: none; border: none; padding: 2px 4px; font-size: 12px; color: var(--ink-faint); }
.unified-copy-close:hover { color: var(--ink-soft); }

/* ===== すっきり整える（同義の棚卸し）：誘い＋プレビュー確認 ===== */
/* 誘い＝カードの下に控えめに。文が増えたらヒント一言（押し付けない）。 */
.unified-tidy { margin: 18px 0 4px; text-align: center; }
.unified-tidy-hint { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; }
.unified-tidy-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease), transform 0.14s var(--ease);
}
.unified-tidy-btn:hover { border-color: var(--accent); color: var(--ink); }
.unified-tidy-btn:active { transform: scale(0.98); }
/* プレビュー＝整え後の確認。確定するまで本文は変わらない。 */
.consolidate-preview { padding: 4px 0 8px; }
.consolidate-loading { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-soft); font-size: 14px; padding: 56px 0; }
.consolidate-banner { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.consolidate-banner.is-tidy { background: var(--accent-soft); border-color: transparent; }
.consolidate-banner-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.consolidate-banner-note { font-size: 12px; color: var(--ink-faint); margin: 0; }
.consolidate-cards { display: flex; flex-direction: column; gap: 12px; }
.consolidate-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.consolidate-card.is-changed { border-color: var(--accent); }
.consolidate-card-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); font-weight: 600; margin: 0 0 8px; }
.consolidate-changed-tag { font-size: 10.5px; font-weight: 500; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.consolidate-list { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 5px; }
.consolidate-list li { font-size: 14px; line-height: 1.6; color: var(--ink); }
.consolidate-empty { font-size: 13px; margin: 0; }
.consolidate-before { margin-top: 8px; }
.consolidate-before summary { font-size: 12px; color: var(--ink-faint); cursor: pointer; list-style: none; }
.consolidate-before summary::-webkit-details-marker { display: none; }
.consolidate-before summary::before { content: "＋ "; }
.consolidate-before[open] summary::before { content: "− "; }
.consolidate-before .consolidate-list { margin-top: 6px; opacity: 0.65; }
.consolidate-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; position: sticky; bottom: 0; padding: 12px 0 calc(env(safe-area-inset-bottom) + 8px); background: transparent; }
.consolidate-apply { min-height: 48px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm); transition: transform 0.14s var(--ease), background 0.14s var(--ease); }
.consolidate-apply:hover { background: var(--accent-press); }
.consolidate-apply:active { transform: scale(0.98); }
.consolidate-cancel { min-height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; transition: border-color 0.14s var(--ease), color 0.14s var(--ease); }
.consolidate-cancel:hover { border-color: var(--accent); color: var(--ink); }
/* 重複の組を1つずつ採用/却下＋手動マージ（③）。 */
.cmerge-section { margin-bottom: 18px; }
.cmerge-cat-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 0 0 8px; }
.cmerge-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; transition: opacity 0.14s var(--ease), border-color 0.14s var(--ease); }
.cmerge-group.is-on { border-color: var(--accent); }
.cmerge-group.is-off { opacity: 0.55; }
.cmerge-group.is-manual { border-style: dashed; border-color: var(--accent); }
.cmerge-froms { display: flex; flex-direction: column; gap: 4px; }
.cmerge-from { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.cmerge-arrow { font-size: 11.5px; color: var(--ink-faint); margin: 8px 0 4px; }
.cmerge-into { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin: 0; font-weight: 500; }
.cmerge-into-edit { width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.55; padding: 8px 10px; resize: vertical; }
.cmerge-actions { margin-top: 10px; }
.cmerge-toggle { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease); }
.cmerge-toggle.is-on { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); border: 1px solid transparent; }
.cmerge-toggle.is-off { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); }
.cmerge-remove { min-height: 32px; padding: 0 12px; border-radius: 999px; background: none; border: 1px solid var(--line-strong); color: var(--ink-faint); font-size: 12px; }
.cmerge-singles { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cmerge-singles-label { font-size: 11.5px; color: var(--ink-faint); margin: 0 0 6px; }
.cmerge-single { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); cursor: pointer; border-radius: 8px; }
.cmerge-single.is-sel { background: var(--accent-soft); color: var(--ink); }
.cmerge-single input { margin-top: 3px; flex: none; }
.cmerge-domanual { display: block; width: 100%; min-height: 40px; margin-top: 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink, var(--accent)); border: 1px solid transparent; font-size: 13px; font-weight: 600; }
.cmerge-hint { font-size: 11.5px; margin: 6px 0 0; }
/* 開いた中の各AIボタンは、控えめなアウトラインに（二番手の中＝主張しすぎない）。取り込み済みは copyout で包まないので塗りのまま。 */
.unified-cta-copyout .cta-ai {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  font-weight: 500;
  font-size: 13px;
  min-height: 40px;
}
.unified-cta-copyout .cta-ai:hover { background: var(--surface); border-color: var(--accent); color: var(--ink); }

/* ---------- 見えてきたこと：トグル（モバイルのみ） ---------- */

.context-toggle {
  position: absolute;
  top: 11px; /* 2段メタの中央線に合わせて少し下げる（作者FB） */
  right: clamp(12px, 3vw, 18px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s var(--ease);
}

.context-toggle[hidden] {
  display: none;
} /* hidden を display:inline-flex より優先（日記では出さない） */
.context-toggle:hover {
  transform: translateY(-1px);
}

.context-toggle-meter {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.context-toggle-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.4s var(--ease);
}

/* ---------- 見えてきたこと：パネル / ボトムシート ---------- */

.context-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-height: 82svh;
  max-height: 82dvh;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  /* .menu-sheet と同じく、閉時の画面外待機中に影が画面下端へはみ出さないよう .open の時だけ影を付ける */
  box-shadow: none;
  transform: translateY(101%);
  transition: transform 0.34s var(--ease), box-shadow 0.34s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.context-panel.open {
  transform: translateY(0);
  box-shadow: var(--shadow-lg);
}

.sheet-handle {
  flex: none;
  display: block;
  width: 100%;
  height: 26px;
  position: relative;
  background: transparent;
}

.sheet-handle::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
}

.context-panel-inner {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px clamp(16px, 4vw, 22px) calc(env(safe-area-inset-bottom) + 20px);
}

.depth-track {
  height: 8px;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: 999px;
}

.depth-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-press));
  border-radius: inherit;
  transition: width 0.5s var(--ease);
}

#depthText {
  margin: 10px 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.context-view {
  display: block;
  margin-bottom: 18px;
}

.panel-sub {
  margin: -4px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.context-invite {
  margin: 0 0 4px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--r-md);
  color: var(--accent-ink);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ---------- 見えてきたこと：波紋（さざ波）の可視化 ---------- */
.mc-water {
  margin: 6px 0 4px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--sand);
  background-image:
    radial-gradient(130% 80% at 30% -10%, rgba(255, 255, 255, 0.10), transparent 62%),
    radial-gradient(120% 90% at 80% 120%, rgba(0, 0, 0, 0.05), transparent 60%);
}

.mc-ripple-field {
  position: relative;
  width: 320px;
  max-width: 100%;
  height: 300px;
  margin: 0 auto;
}

.mc-ripple-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
}

.mc-ripple-svg circle {
  fill: none;
  stroke: var(--ripple-ring);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.mc-ripple-svg circle.r0 { stroke-opacity: 0.85; }
.mc-ripple-svg circle.r1 { stroke-opacity: 0.5; }
.mc-ripple-svg circle.r2 { stroke-opacity: 0.22; }

.mc-ripple-svg .rp.picked circle {
  stroke: var(--ripple-core);
  stroke-width: 1.4;
  stroke-opacity: 0.8;
}

.mc-ripple-svg .rp-core {
  fill: var(--ripple-core);
  stroke: none;
}

/* まだ聞けていないこと（無知の知）＝輪郭の薄い点線の波紋 */
.mc-ripple-svg .rp.open circle {
  stroke: var(--ink-faint);
  stroke-dasharray: 2 5;
}
.mc-ripple-svg .rp.open circle.r0 { stroke-opacity: 0.5; }
.mc-ripple-svg .rp.open circle.r1 { stroke-opacity: 0.3; }
.mc-ripple-svg .rp.open.picked circle {
  stroke: var(--accent);
  stroke-opacity: 0.7;
}

.mc-rip-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-soft);
  opacity: 0.96;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.mc-rip-label:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.mc-rip-label.picked {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.mc-rip-label.open {
  border-style: dashed;
  background: transparent;
  color: var(--ink-faint);
  box-shadow: none;
  min-width: 30px;
  text-align: center;
  font-size: 13px;
}

.mc-rip-label.open.picked {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.mc-water-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
}

.mc-water-card:empty {
  display: none;
}

.mc-stone-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  animation: bubble-in 0.2s var(--ease);
}

/* 開いた説明カードを閉じる×（右上・控えめ） */
.mc-card-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
}
.mc-card-close:hover { color: var(--ink-soft); background: var(--accent-soft); }
.mc-stone-card .mc-card-eyebrow { padding-right: 26px; }

.mc-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}

.mc-card-eyebrow.open {
  color: var(--ink-soft);
}

.mc-quote {
  margin: 7px 0 9px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

.mc-scope {
  font-size: 12px;
  color: var(--ink-faint);
}

.mc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mc-open-card {
  border-style: dashed;
}

.mc-stone-card.editing .inline-edit {
  margin-top: 8px;
}

/* 本人の言葉（一次資料）は明朝で静かに残す */
.words-well {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
}

.words-well-head {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}

.words-well-quote {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}

/* 自分のことばで書き加える・整える（任意・既定は畳む。インライン編集の差別化を残す） */
.manual-add {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.manual-add-toggle {
  padding: 6px 2px;
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.manual-add-toggle:hover {
  color: var(--ink-soft);
  border-bottom-color: var(--line-strong);
}

.manual-add-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.context-item {
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}

.context-item.filled {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.context-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.context-item-head strong {
  margin-bottom: 0;
}

.context-edit-btn {
  padding: 2px 8px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.context-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--surface);
}

.edited-mark {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 700;
}

.context-item.editing {
  background: var(--surface);
  border-left-color: var(--accent);
}

.inline-edit {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  padding: 10px 12px;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.inline-edit:focus {
  outline: none;
  border-color: var(--accent);
}

.inline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.inline-actions .ghost-button,
.inline-actions .primary-button {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

.inline-actions .primary-button.inline-save {
  padding: 6px 16px;
}

.context-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-ink);
}

.context-item span {
  font-size: 13.5px;
  color: var(--ink);
}

.context-item.empty span em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.context-item.words {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.context-item.words strong {
  color: var(--gold-ink);
}

/* どんな時も共通のあなた（全場面で共有されるレイヤー） */
.context-common {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.context-common-head {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-ink);
}

.context-item.common {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.context-item.common strong {
  color: var(--gold-ink);
}

.common-item-actions {
  display: inline-flex;
  gap: 8px;
  flex-shrink: 0;
}

.context-item.unknowns {
  border-left-color: var(--rose);
  background: var(--rose-soft);
}

.context-item.unknowns strong {
  color: var(--rose);
}

.context-item.unknowns ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.context-item.unknowns li {
  font-size: 13px;
  color: var(--rose-ink);
}

.panel-note {
  margin: 12px 2px 0;
  font-size: 12px;
  text-align: center;
}

/* パネル内の「メモを読み込む」 */
.panel-import {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-import .ghost-button {
  width: 100%;
}

.panel-import .panel-note {
  text-align: left;
  margin: 8px 2px 0;
}

.panel-import .imported-list:not(:empty) {
  margin-top: 10px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(20, 22, 26, 0.42);
  backdrop-filter: blur(2px);
  animation: fade-in 0.24s var(--ease);
}

.sheet-backdrop[hidden] {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================================================
   結果画面
   ========================================================= */

.result-layout {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px) clamp(16px, 4vw, 28px) 64px;
  display: grid;
  gap: 16px;
}

.result-hero {
  padding: clamp(22px, 4vw, 34px);
  background: linear-gradient(155deg, var(--accent), var(--accent-press));
  border-radius: var(--r-xl);
  color: var(--on-accent);
  box-shadow: var(--shadow-md);
}

.result-hero h1 {
  margin: 4px 0 12px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.18;
}

.result-hero .eyebrow,
.result-hero .lead {
  color: rgba(255, 255, 255, 0.86);
}

.result-hero .lead {
  margin: 0;
  font-size: 15px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.summary-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-ink);
}

.summary-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14.5px;
  white-space: pre-line;
}

.summary-card.featured {
  background: var(--accent-soft);
  border-color: transparent;
}

.summary-card.attention {
  background: var(--rose-soft);
  border-color: transparent;
}

.summary-card.attention h3 {
  color: var(--rose);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.brief-panel,
.next-panel,
.use-panel {
  padding: clamp(20px, 4vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* 「使う」パネル＝価値の最後の一歩 */
.use-panel {
  display: grid;
  gap: 16px;
  background: var(--accent-soft);
  border-color: transparent;
}

.use-panel h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.use-panel p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
}

.use-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.use-actions .primary-button {
  flex: 1 1 auto;
}

.brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brief-actions .secondary-button,
.brief-actions .primary-button {
  min-height: 42px;
  padding: 9px 16px;
  font-size: 14px;
}

.brief-textarea {
  width: 100%;
  min-height: 440px;
  padding: 18px;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.75;
}

.brief-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.next-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.next-panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.next-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.next-actions .secondary-button {
  min-height: 44px;
  font-size: 14px;
}

/* =========================================================
   相談デスク（核心仮説：雑→磨かれた）
   ========================================================= */

.consult-layout {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px) clamp(16px, 4vw, 28px) 64px;
  display: grid;
  gap: 16px;
}

.consult-hero {
  padding: clamp(22px, 4vw, 32px);
  background: linear-gradient(150deg, var(--accent), var(--accent-press));
  color: var(--on-accent);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}

.consult-hero h1 {
  margin: 4px 0 10px;
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.2;
}

.consult-hero .eyebrow,
.consult-hero .lead {
  color: rgba(255, 255, 255, 0.92);
}

.consult-hero .lead {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
}

.consult-hero strong {
  color: var(--on-accent);
  font-weight: 800;
}

.consult-input-card {
  padding: clamp(18px, 4vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.consult-question {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.consult-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.consult-actions .primary-button {
  flex: 1 1 auto;
}
.consult-wait-note {
  margin: 10px 2px 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.7;
}

/* 磨いている間の進捗表示（チャット/統合と同じ thinking-dots を流用）＝動いている安心 */
.consult-progress {
  display: block;
  margin-top: 14px;
  padding: 6px 0 2px;
}
.consult-progress[hidden] { display: none; } /* hidden を display:block より優先 */

.consult-output {
  display: grid;
  gap: 16px;
}

.clarifying-card {
  padding: clamp(18px, 4vw, 24px);
  background: var(--gold-soft);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
}

.clarifying-card .eyebrow {
  color: var(--gold-ink);
}

.clarifying-card > p.muted {
  margin: 4px 0 14px;
  font-size: 13.5px;
}

.clarifying-item {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid rgba(155, 102, 32, 0.18);
}

.clarifying-item:first-of-type {
  border-top: 0;
}

.clarifying-item strong {
  font-size: 15px;
  color: var(--gold-ink);
}

.clarifying-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--gold-ink);
  opacity: 0.8;
}

.clarifying-answer {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: 14px;
  resize: vertical;
}

.clarifying-answer:focus {
  outline: none;
  border-color: var(--accent);
}

.clarifying-actions {
  margin-top: 14px;
}

.use-panel-divider {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(31, 122, 115, 0.3);
  font-size: 13px;
}

.use-panel-divider a {
  color: var(--accent-ink);
  font-weight: 700;
}

/* =========================================================
   設定モーダル
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(20, 22, 26, 0.45);
  backdrop-filter: blur(3px);
  animation: fade-in 0.22s var(--ease);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 22px clamp(18px, 5vw, 26px) calc(env(safe-area-inset-bottom) + 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.3s var(--ease);
}

@keyframes sheet-up {
  from {
    transform: translateY(28px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-card .section-heading h2 {
  font-size: 19px;
}

.modal-card .muted {
  font-size: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

.field-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-hint {
  font-size: 12.5px;
  line-height: 1.6;
}

.question-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.question-actions .secondary-button,
.question-actions .primary-button {
  flex: 1;
}

/* リマインドメールのオプトイン・トグル（設定モーダル）。控えめに・タップしやすく・ネイティブのチェックを accent 色で */
.setting-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.setting-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.backup-actions .secondary-button {
  flex: 1 1 auto;
  min-height: 44px;
  font-size: 13.5px;
}

/* 日記の書き出し（どの私／期間をしぼって Markdown 保存） */
.journal-export {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.journal-export-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 12px;
}
.je-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.je-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.je-select,
.je-date {
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.je-dates {
  display: flex;
  gap: 10px;
}
.je-dates .je-field {
  flex: 1 1 0;
}
.journal-export .secondary-button {
  width: 100%;
  min-height: 44px;
  font-size: 13.5px;
}

/* すべて消す：警告色の赤は使わず、中和された臙脂(--rose-ink)の控えめなテキストリンク。深刻さは確認ダイアログで担保する */
.danger-link {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 2px;
  background: none;
  border: none;
  color: var(--rose-ink);
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.82;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}
.danger-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* 完全バックアップ・復元は折りたたんで控えめに（主役は「コンテキストを書き出す」） */
.backup-more {
  margin-top: 16px;
}
.backup-more > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 4px 2px;
}
.backup-more > summary::-webkit-details-marker { display: none; }
.backup-more > summary::before {
  content: "▸";
  color: var(--ink-faint);
  margin-right: 6px;
  font-size: 10px;
}
.backup-more[open] > summary::before { content: "▾"; }
.backup-more .backup-actions { margin-top: 10px; }

/* =========================================================
   トースト
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  /* 下部に貼り付くAIボタンの帯(.unified-cta 約90px)やチャット入力欄に重ならないよう、十分に上へ逃がす */
  bottom: calc(env(safe-area-inset-bottom) + 104px);
  z-index: 60;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 18px;
  transform: translate(-50%, 18px);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* =========================================================
   デスクトップ：見えてきたことを右サイドに常駐
   ========================================================= */

@media (min-width: 900px) {
  .chat-screen {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    padding: 8px 20px 0;
  }

  .chat-main {
    border-right: 0;
  }

  .context-toggle,
  .context-panel .sheet-handle {
    display: none;
  }

  .context-panel {
    position: static;
    z-index: auto;
    max-height: none;
    height: 100%;
    transform: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transition: none;
  }

  .context-panel-inner {
    height: 100%;
    padding: 18px 4px 24px;
  }

  #sheetBackdrop {
    display: none !important;
  }
}

/* タブレット以下：結果カードを1列に */
@media (max-width: 620px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
  }

  .next-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .next-actions .secondary-button {
    flex: 1;
  }
}

/* モーション軽減の尊重 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================================================
   新ホーム（庭と水面）／ジャーナリング／問いで発見する（折衷D）
   2026-06 Claude Design 反映。新機能（モード分岐・日記・問いの遷移先）は
   app.js 側の配線が必要。既存クラス/idは削っていない（追加のみ）。
   =========================================================== */

/* ---- ホーム：枯山水＋2モード＋水面プール ---- */
/* ===== ホーム：上＝枯山水（はなす）／下＝水面（つかう）。摩擦最優先のレイアウト修正込み ===== */
  .g{ width:min(540px,100%); max-width:100%; margin:0 auto; min-height:100%; display:flex; flex-direction:column; padding:clamp(14px,4vw,26px) 0 0; overflow-x:hidden; overscroll-behavior-x:none; touch-action:pan-y; }
  /* 枯山水：ごく淡い砂紋を、はなすの背後に */
  .g-dry{ position:relative; max-width:100%; overflow:hidden; padding:0 clamp(22px,6vw,30px) 14px; }
  .g-sand{ position:absolute; inset:-10px 0 0; display:block; width:100%; max-width:100%; height:calc(100% + 10px); overflow:hidden; pointer-events:none; opacity:.6; }
  .g-sand path{ fill:none; stroke:var(--sand-line); stroke-width:1; }
  .g-in{ position:relative; z-index:1; }
  .g-kao{ font-size:11px; font-weight:700; letter-spacing:.22em; color:var(--ink-faint); margin:0 0 14px; }
  .g-q{ margin:0; font-size:clamp(27px,8vw,31px); font-weight:400; line-height:1.5; letter-spacing:.02em; color:var(--ink); }
  .g-say{ margin:10px 0 0; color:var(--ink-soft); font-size:14px; line-height:1.75; }
  /* 場面の設定：いまの私＋問いの立て方（横並び・元トップページの作法） */
  .g-sel{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
  .g-selbtn{ display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:999px;
             background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-sm); color:var(--ink-soft); font-size:12.5px;
             transition:border-color .15s var(--ease), transform .15s var(--ease); }
  .g-selbtn:hover{ border-color:var(--line-strong); transform:translateY(-1px); }
  .g-selnow{ color:var(--ink-faint); font-size:11px; font-weight:700; }
  .g-selbtn strong{ color:var(--accent-ink); font-weight:800; }
  .g-selcaret{ color:var(--ink-faint); font-size:11px; }
  /* 話題：3＋「ほかの話題」で 2×2（読みやすい2行） */
  .g-topics{ display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:18px; }
  .g-topic{ padding:13px 16px; border-radius:14px; border:1px solid var(--line-strong); background:rgba(243,245,246,.72);
            color:var(--ink); font-size:14.5px; font-weight:500; text-align:left; backdrop-filter:blur(1px);
            transition:border-color .15s var(--ease), transform .15s var(--ease); }
  .g-topic:hover{ border-color:var(--accent); transform:translateY(-1px); }
  /* その他の話題 ／ 話を振ってもらう を同じ行に（元トップの作法） */
  .g-lead{ display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:10px; }
  .g-leadbtn{ padding:13px 14px; border-radius:14px; font-size:14px; font-weight:600; text-align:center;
              border:1px solid var(--line-strong); background:var(--surface); color:var(--ink);
              transition:transform .15s var(--ease), border-color .15s var(--ease); }
  .g-leadbtn:hover{ transform:translateY(-1px); border-color:var(--accent); }
  .g-leadbtn.more{ border-style:dashed; border-color:var(--accent); color:var(--accent-ink); background:transparent; }
  .g-leadbtn.lead{ background:var(--accent-soft); color:var(--accent-ink); border-color:transparent; }
  /* 設定の主従：問いの立て方（従）を一段控えめに */
  .g-selbtn.sub{ background:transparent; border-color:var(--line); box-shadow:none; }
  .g-selbtn.sub .g-selnow{ color:var(--ink-faint); }
  .g-selbtn.sub strong{ color:var(--ink-soft); font-weight:700; }
  /* 話す：2つの入り方（ジャーナリング／問いで発見する） */
  .modes{ display:flex; flex-direction:column; gap:10px; margin-top:18px; }
  .mode{ display:flex; align-items:center; gap:14px; width:100%; padding:16px 18px; border-radius:18px;
         border:1px solid var(--line-strong); background:rgba(243,245,246,.72); text-align:left; backdrop-filter:blur(1px);
         transition:border-color .15s var(--ease), transform .15s var(--ease); }
  .mode:hover{ border-color:var(--accent); transform:translateY(-1px); }
  .mode-ico{ flex:none; width:38px; height:38px; display:grid; place-items:center; color:var(--accent); }
  .mode-ico svg{ width:38px; height:38px; }
  .mode-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
  .mode-label{ font-size:16px; font-weight:500; color:var(--ink); }
  .mode-sub{ font-size:12.5px; color:var(--ink-faint); line-height:1.5; }
  .mode-arr{ flex:none; color:var(--ink-faint); font-size:20px; }
  /* つかう：下部の一枚板ではなく、はなすと同じ幅のカード群として見せる */
  .g-pool{ position:relative; max-width:100%; margin-top:8px; flex:none; min-height:auto;
           padding:16px clamp(22px,6vw,30px) calc(env(safe-area-inset-bottom) + 26px);
           overflow:hidden; background:transparent; }
  .g-ripple{ position:absolute; inset:-18px 0 auto; display:block; width:100%; max-width:100%; height:168px; overflow:hidden; pointer-events:none; opacity:.36; }
  .g-ripple circle{ fill:none; stroke:var(--ripple-ring); stroke-width:1; vector-effect:non-scaling-stroke; }
  .g-poolin{ position:relative; z-index:1; }
  .g-use-kao{ margin-bottom:12px; }
  .g-use-cards{ display:flex; flex-direction:column; gap:10px; }
  .g-use-card{ display:flex; align-items:center; gap:14px; width:100%; min-height:82px; padding:16px 18px; border-radius:18px;
               border:1px solid var(--line-strong); background:rgba(243,245,246,.72); text-align:left; backdrop-filter:blur(1px);
               transition:border-color .15s var(--ease), transform .15s var(--ease), background .15s var(--ease); }
  .g-use-card:hover{ border-color:var(--accent); transform:translateY(-1px); }
  .g-use-ico{ flex:none; width:38px; height:38px; display:grid; place-items:center; color:var(--accent); }
  .g-use-ico svg{ width:38px; height:38px; }
  .g-use-ico circle,
  .g-use-ico path{ fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
  .g-use-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
  .g-use-label{ font-size:16px; font-weight:500; color:var(--ink); }
  .g-use-sub{ font-size:12.5px; color:var(--ink-faint); line-height:1.5; }
  .g-use-meta{ display:block; margin-top:2px; font-size:11.5px; color:var(--ink-faint); line-height:1.45; }
  .g-use-arr{ flex:none; color:var(--ink-faint); font-size:20px; }

/* 夜トーン時は、ホームの固定色カードも背景と同じ青墨系へ寄せる。 */
:root[data-theme="yoru"] .g-dry,
:root[data-theme="night"] .g-dry,
:root[data-theme="dark"] .g-dry {
  color: var(--ink);
}
:root[data-theme="yoru"] .g-sand,
:root[data-theme="night"] .g-sand,
:root[data-theme="dark"] .g-sand {
  opacity: 0.36;
}
:root[data-theme="yoru"] .mode,
:root[data-theme="night"] .mode,
:root[data-theme="dark"] .mode,
:root[data-theme="yoru"] .g-use-card,
:root[data-theme="night"] .g-use-card,
:root[data-theme="dark"] .g-use-card,
:root[data-theme="yoru"] .g-topic,
:root[data-theme="night"] .g-topic,
:root[data-theme="dark"] .g-topic {
  background: rgba(31, 42, 50, 0.72);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
:root[data-theme="yoru"] .mode:hover,
:root[data-theme="night"] .mode:hover,
:root[data-theme="dark"] .mode:hover,
:root[data-theme="yoru"] .g-use-card:hover,
:root[data-theme="night"] .g-use-card:hover,
:root[data-theme="dark"] .g-use-card:hover,
:root[data-theme="yoru"] .g-topic:hover,
:root[data-theme="night"] .g-topic:hover,
:root[data-theme="dark"] .g-topic:hover {
  background: rgba(39, 53, 63, 0.82);
}
:root[data-theme="yoru"] .g-pool,
:root[data-theme="night"] .g-pool,
:root[data-theme="dark"] .g-pool {
  background: transparent;
}
:root[data-theme="yoru"] .g-ripple,
:root[data-theme="night"] .g-ripple,
:root[data-theme="dark"] .g-ripple {
  opacity: 0.28;
}

/* PCブラウザだけ：スマホ用に下まで満たす水面を、デスクトップでは読みやすいカード量に抑える */
@media (min-width: 900px) {
  .g {
    width: min(620px, 100%);
    min-height: auto;
    padding-top: 22px;
    padding-bottom: 48px;
  }

  .g-dry {
    padding-bottom: 18px;
  }

  .g-pool {
    flex: none;
    min-height: auto;
    margin-top: 10px;
    padding-top: 18px;
    padding-bottom: 30px;
    border-radius: 0;
    box-shadow: none;
  }

  .g-ripple {
    opacity: .28;
  }

  .menu-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(760px, calc(100vw - 96px));
    max-height: min(760px, calc(100dvh - 96px));
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    transform: translate(-50%, calc(50dvh + 24px));
  }

  .menu-sheet.open {
    transform: translate(-50%, -50%);
  }

  /* 設定サブシート表示中の「奥に沈む」＝デスクトップでは中央寄せ（translate -50%）を保ったまま沈める。
     ★これが無いと、メディアクエリ外の .menu-sheet.open.behind（詳細度0,3,0）が中央寄せを消し、
       メニューが画面右下へ飛んで半分見切れる（push前レビューで検出・z316）。 */
  .menu-sheet.open.behind {
    transform: translate(-50%, calc(-50% + 26px)) scale(0.975);
  }

  .menu-sheet > .sheet-handle {
    height: 44px;
    border-bottom: 1px solid var(--line);
  }

  .menu-sheet > .sheet-handle::before {
    top: 20px;
    width: 34px;
    height: 3px;
  }

  .menu-sheet > .sheet-handle::after {
    content: "閉じる";
    position: absolute;
    top: 12px;
    right: 22px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
  }

  .menu-sheet-inner {
    padding: 6px 28px 28px;
  }
}

/* Paywallだけはボトムシートではなく中央のポップアップとして見せる。 */
#paywallBackdrop {
  z-index: 1180;
}

#paywallSheet {
  left: 50%;
  right: auto;
  bottom: auto;
  top: 50%;
  z-index: 1190;
  width: min(520px, calc(100vw - 32px));
  max-height: min(760px, calc(100svh - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  transform: translate(-50%, calc(-50% + 18px)) scale(.985);
  opacity: 0;
  transition: transform .24s var(--ease), opacity .18s ease;
}

#paywallSheet.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

#paywallSheet > .sheet-handle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(243, 245, 246, .86);
  box-shadow: var(--shadow-sm);
}

#paywallSheet > .sheet-handle::before,
#paywallSheet > .sheet-handle::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 10px;
  width: 16px;
  height: 1.6px;
  border-radius: 999px;
  background: var(--ink-soft);
}

#paywallSheet > .sheet-handle::before {
  transform: rotate(45deg);
}

#paywallSheet > .sheet-handle::after {
  transform: rotate(-45deg);
}

#paywallSheet .menu-sheet-inner {
  padding: 34px clamp(18px, 4.8vw, 28px) calc(env(safe-area-inset-bottom) + 24px);
}

@media (max-width: 420px) {
  #paywallSheet {
    width: calc(100vw - 24px);
    max-height: min(760px, calc(100svh - 24px));
    max-height: min(760px, calc(100dvh - 24px));
    border-radius: 22px;
  }
}

/* ---- 日記：書く（深掘りボタン） ---- */
.jw{ width:min(620px,100%); margin:0 auto; height:100%; display:flex; flex-direction:column; padding:6px clamp(20px,5vw,30px) 0; }
  .jw-top{ flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 0 10px; }
  .jw-top-left{ display:flex; align-items:center; gap:12px; }
  /* 日記＝とじる＋使い方は左（別要素とくっつけない・作者FB）。いまの私だけ右。使い方でこの画面のツアーをいつでも呼べる。 */
  .jw-top-right{ display:flex; align-items:center; gap:10px; }
  .jw-help{ background:none; border:0; color:var(--ink-soft); font-size:13px; padding:4px 2px; }
  .jw-help:hover{ color:var(--accent-ink); }
  .jw-back{ background:none; border:0; color:var(--ink-soft); font-size:14px; padding:4px 2px; cursor:pointer; }
  /* 「削除」は控えめに（中和臙脂・誤タップ防止に保存ボタンから離した上部に） */
  .jw-del{ background:none; border:0; color:var(--rose-ink); font-size:13px; opacity:.8; padding:4px 2px; cursor:pointer; }
  .jw-del:hover{ opacity:1; text-decoration:underline; }
  .jw-now{ display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; background:var(--surface); border:1px solid var(--line); font-size:12px; color:var(--ink-soft); }
  .jw-now strong{ color:var(--accent-ink); font-weight:800; }
  /* 日付＋タイトルを1行に（縦に長くしない・日付の横にタイトル）。タイトルが見出しより太い逆転をなくし、間を取る。 */
  .jw-daterow{ flex:none; display:flex; align-items:baseline; gap:16px; padding:2px 0 8px; }
  .jw-date{ flex:none; }
  .jw-date b{ font-size:19px; font-weight:500; color:var(--ink); }
  .jw-date span{ margin-left:8px; font-size:12.5px; color:var(--ink-faint); }
  /* ★z232：書き込み画面では日付曜日を非表示にする（renderJournalWrite が innerHTML="" にする）。
     :empty で日付要素ごと畳み、タイトルの縦線と左パディングも自動で消す＝タイトルが左端に寄る。 */
  .jw-date:empty{ display:none; }
  .jw-date:empty + .jw-title{ border-left:0; padding-left:0; }
  /* 任意タイトル：同じフォント・日付見出しと同じ太さ(500)・少し小さく(16.5px)で馴染ませる（見出しより太くしない）。区切りに淡い縦線。 */
  .jw-title{ flex:1 1 auto; min-width:0; border:0; border-left:1px solid var(--line); background:transparent; outline:none;
             color:var(--ink); font-family:var(--font-ui); font-size:16.5px; font-weight:500; line-height:1.25; padding:1px 0 1px 16px; }
  .jw-title::placeholder{ color:var(--ink-faint); font-weight:400; }
  .jw-area{ flex:0 0 auto; min-height:160px; width:100%; box-sizing:border-box; border:0; background:transparent; resize:none; outline:none; overflow:hidden;
            color:var(--ink); font-family:var(--font-ui); font-size:17px; line-height:2; padding:8px 0 16px; }
  .jw-area::placeholder{ color:var(--ink-faint); }
  .jw-bar{ flex:none; display:flex; align-items:center; gap:12px; padding:10px 0 calc(env(safe-area-inset-bottom) + 16px);
           background:transparent; }
  .jw-mic{ flex:none; width:46px; height:46px; border-radius:50%; display:grid; place-items:center;
           background:var(--surface); border:1px solid var(--line-strong); color:var(--ink-soft); }
  .jw-hint{ flex:1; font-size:12px; color:var(--ink-faint); line-height:1.5; }
  .jw-save{ flex:none; min-height:46px; padding:12px 24px; border-radius:999px; background:var(--accent); color:var(--on-accent);
            font-weight:600; font-size:14.5px; box-shadow:var(--shadow-sm); }
  /* 書いている最中の「深掘りの問い」 */
  .jw-depth{ flex:none; }
  .jw-depth-btn{ display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border-radius:999px; background:transparent;
                 border:1px solid var(--line-strong); color:var(--ink-soft); font-size:13px;
                 transition:border-color .15s var(--ease), color .15s var(--ease); }
  .jw-depth-btn:hover{ border-color:var(--accent); color:var(--accent-ink); }
  .jw-depth-q{ position:relative; margin-top:10px; padding:13px 36px 13px 15px; border-radius:13px; background:var(--accent-soft);
               color:var(--accent-ink); font-size:14.5px; line-height:1.7; }
  .jw-depth-tag{ display:block; font-size:10.5px; font-weight:700; letter-spacing:.1em; opacity:.75; margin-bottom:4px; }
  .jw-depth-x{ position:absolute; top:8px; right:10px; width:24px; height:24px; border:0; background:transparent; color:var(--accent-ink);
               font-size:17px; line-height:1; opacity:.6; cursor:pointer; }
  .jw-depth-x:hover{ opacity:1; }

/* ---- 日記：受け取り（そっと見えてきたこと） ---- */
.ja{ width:min(560px,100%); margin:0 auto; min-height:100%; display:flex; flex-direction:column;
       padding:clamp(14px,4vw,24px) clamp(20px,5vw,30px) calc(env(safe-area-inset-bottom) + 24px); }
  .ja-kao{ font-size:11px; font-weight:700; letter-spacing:.22em; color:var(--ink-faint); margin:8px 0 12px; }
  .ja-h{ margin:0; font-size:clamp(24px,7vw,28px); font-weight:400; line-height:1.5; letter-spacing:.02em; color:var(--ink); }
  .ja-sub{ margin:10px 0 0; color:var(--ink-soft); font-size:14px; line-height:1.7; }
  /* 残した日記（本人の言葉＝明朝で保全） */
  /* 振り返り画面の見出し＝日付＋タイトル（少し大きめ＝後から読み返す時の目印）。定型の挨拶は廃止しこれが先頭に来る。 */
  .ja-entry-title{ margin:6px 0 20px; font-size:clamp(19px,5.2vw,22px); font-weight:500; line-height:1.5; letter-spacing:.02em; color:var(--ink); }
  .ja-entry{ margin:22px 0 0; padding-left:15px; border-left:2px solid var(--line-strong); }
  .ja-entry-date{ margin:0 0 7px; font-size:11.5px; font-weight:700; color:var(--ink-faint); }
  .ja-entry-text{ margin:0; font-family:var(--font-mincho); font-size:15.5px; line-height:1.95; color:var(--ink); }
  /* そっと、見えてきたこと（裏の魔法：自由記述→コンテキスト。断定しない・直せる） */
  .ja-noticed{ margin:26px 0 0; padding:18px 18px 16px; border-radius:var(--r-lg); background:var(--accent-soft); }
  .ja-noticed-h{ margin:0 0 12px; font-size:12px; font-weight:700; letter-spacing:.04em; color:var(--accent-ink); }
  .ja-item{ display:flex; gap:11px; padding:9px 0; }
  .ja-item + .ja-item{ border-top:1px solid rgba(90,117,133,.16); }
  .ja-item-k{ flex:none; width:7.5em; font-size:11.5px; font-weight:700; color:var(--accent-ink); line-height:1.7; }
  .ja-item-v{ font-size:14px; color:var(--ink); line-height:1.65; }
  .ja-noticed-note{ margin:12px 0 0; font-size:11.5px; line-height:1.6; color:var(--accent-ink); opacity:.85; }
  /* よかったら、もう一問（任意・無視できる＝摩擦ゼロ） */
  .ja-q{ margin:18px 0 0; padding:15px 16px; border-radius:var(--r-md); background:var(--surface); border:1px solid var(--line); }
  .ja-q-label{ margin:0 0 6px; font-size:11px; font-weight:700; letter-spacing:.04em; color:var(--ink-faint); }
  .ja-q-text{ margin:0 0 12px; font-size:15px; line-height:1.7; color:var(--ink); }
  .ja-q-actions{ display:flex; gap:9px; }
  .ja-q-yes{ min-height:40px; padding:9px 18px; border-radius:999px; background:var(--accent-soft); color:var(--accent-ink); font-size:13.5px; font-weight:600; border:1px solid transparent; }
  .ja-q-no{ min-height:40px; padding:9px 16px; border-radius:999px; background:transparent; color:var(--ink-faint); font-size:13px; border:1px solid var(--line); }
  .ja-foot{ margin-top:auto; padding-top:22px; display:flex; gap:9px; }
  .ja-see{ flex:1; min-height:46px; border-radius:14px; background:var(--accent); color:var(--on-accent); font-weight:600; font-size:14px; box-shadow:var(--shadow-sm); }
  .ja-close{ flex:none; min-height:46px; padding:12px 20px; border-radius:14px; background:var(--surface); border:1px solid var(--line-strong); color:var(--ink-soft); font-size:14px; font-weight:600; }
  /* 日記一覧へ戻る（後から読み返して別の日記へ移れる導線・控えめなテキストボタン） */
  .ja-tolist{ width:100%; margin-top:2px; min-height:40px; background:none; border:0; color:var(--ink-soft); font-size:13px; font-weight:600; cursor:pointer; }
  .ja-tolist:hover{ color:var(--accent-ink); }

/* ---- 私を取り込む（#import）：他のAI/手持ち文章からの取り込み入口 ---- */
/* フィードバック・お問い合わせ（#feedback）。取り込み画面と同じ作法の縦フォーム。 */
.fb { position: relative; width: min(560px, 100%); margin: 0 auto; min-height: 100%; display: flex; flex-direction: column;
  padding: 6px clamp(22px, 6vw, 30px) calc(env(safe-area-inset-bottom) + 28px); }
.fb-label { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kind { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--ink-soft); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease); }
.fb-kind:hover { border-color: var(--accent); }
.fb-kind.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fb-body { width: 100%; min-height: 130px; padding: 14px 16px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.7; color: var(--ink); resize: vertical; }
.fb-body:focus { outline: none; border-color: var(--accent); }
.fb-input { width: 100%; margin-top: 8px; padding: 12px 16px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-family: var(--font-ui); font-size: 15px; color: var(--ink); }
.fb-input:focus { outline: none; border-color: var(--accent); }
.fb-note { margin: 8px 2px 0; font-size: 12px; line-height: 1.6; }
.fb .primary-button.block { margin-top: 16px; }
.fb-done { text-align: center; padding: 40px 8px; }
.fb-done-kao { font-size: 20px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.fb-done-msg { font-size: 14.5px; line-height: 1.8; color: var(--ink-soft); margin: 0 0 24px; }

.imp { position: relative; width: min(560px, 100%); margin: 0 auto; min-height: 100%; display: flex; flex-direction: column;
  padding: 6px clamp(22px, 6vw, 30px) calc(env(safe-area-inset-bottom) + 28px); }
.imp > .chat-ripple { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.imp > *:not(.chat-ripple) { position: relative; z-index: 1; }
.imp-paste {
  width: 100%; min-height: 150px; margin-top: 6px; padding: 14px 16px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.7; color: var(--ink); resize: vertical;
}
.imp-paste:focus { outline: none; border-color: var(--accent); }
.imp .primary-button.block { margin-top: 12px; }
.imp-how { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.imp-how > summary { list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); padding: 4px 0; }
.imp-how > summary::-webkit-details-marker { display: none; }
.imp-how > summary::before { content: "＋ "; color: var(--ink-faint); }
.imp-how[open] > summary::before { content: "− "; }
.imp-how-body { padding: 8px 2px 2px; }
.imp-how-lead { margin: 6px 0 8px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.imp-how-quote { margin: 0 0 8px; padding: 11px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; line-height: 1.75; }
.imp-how-copy { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 12px; padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--accent-ink); font-size: 12.5px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.imp-how-copy:hover { background: var(--accent-soft); border-color: var(--accent); }
.imp-how-copy:active { transform: translateY(1px); }
.imp-how-copy svg { opacity: .75; }
.imp-how-note { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); }
.imp-how-apps { margin: 0 0 10px; padding-left: 1.1em; }
.imp-how-apps li { font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 6px; }
.imp-how-apps strong { color: var(--ink); font-weight: 600; }
.imp-how-foot { font-size: 11.5px; line-height: 1.6; }
.imp-file { margin-top: 16px; align-self: flex-start; background: none; border: 0; color: var(--ink-soft); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; }
.imp-file:hover { color: var(--accent-ink); }

/* ---- ホームの初回「他のAIから自分を連れてくる」カード（材料が無い時だけ・一番上） ---- */
.home-import { margin: 6px clamp(22px, 6vw, 30px) 4px; }
.home-import[hidden] { display: none; }
.home-import-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 15px 16px; border-radius: var(--r-lg);
  background: var(--accent-soft); border: 1px solid var(--line);
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.home-import-card:hover { border-color: var(--accent); }
.home-import-card:active { transform: scale(0.99); }
.home-import-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-import-label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.home-import-sub { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.home-import-arr { flex: none; color: var(--accent-ink); font-size: 18px; }

/* ---- 問いで発見する（折衷D：おまかせ＋必ず選べる） ---- */
.q{ position:relative; width:min(540px,100%); margin:0 auto; min-height:100%; display:flex; flex-direction:column; padding:6px clamp(22px,6vw,30px) calc(env(safe-area-inset-bottom) + 24px); }
/* 各画面の右上「使い方」＝もどる(左)の反対側に置く。タップでその画面のツアー/案内をいつでも呼べる（作者FB 2026-06-13）。
   基本＝素のテキストボタン（フレックスの中＝あなたのコンテキストの上部バー等で使う）。 */
.scr-help{ background:none; border:0; color:var(--ink-soft); font-size:14px; padding:8px 2px; white-space:nowrap; }
.scr-help:hover{ color:var(--accent-ink); }
/* 取り込む(.imp)/問い(.q)/相談デスク(.consult-layout) は、画面の右上に絶対配置する。
   ★.imp/.q は子を全部 position:relative にする規則があるので、より具体的なセレクタで absolute に上書きする（でないとフレックスで全幅に伸びる）。 */
.imp > .scr-help, .q > .scr-help, .consult-layout > .scr-help{ position:absolute; top:6px; right:clamp(16px,6vw,30px); z-index:3; width:auto; }
.consult-layout{ position:relative; }
/* あなたのコンテキストの上部バー右側＝使い方＋トーン切替を並べる */
/* あなたのコンテキスト＝もどる＋使い方を左でひとまとめ（くっつき過ぎないgap）。霧トーンは右に独立。 */
.unified-topbar-left{ display:flex; align-items:center; gap:14px; }
/* もどる(.link-button)の margin-top:10px を打ち消す＝使い方と縦中心を揃える。 */
.unified-topbar-left .link-button{ margin-top:0; }
  .q-back{ background:none; border:0; color:var(--ink-soft); font-size:14px; padding:8px 2px; text-align:left; }
  .q-kao{ font-size:11px; font-weight:700; letter-spacing:.22em; color:var(--ink-faint); margin:6px 0 10px; }
  .q-h{ margin:0 0 4px; font-size:clamp(24px,7vw,28px); font-weight:400; line-height:1.45; color:var(--ink); }
  .q-sub{ margin:0 0 20px; color:var(--ink-soft); font-size:13.5px; line-height:1.7; }
  .q-label{ font-size:11px; font-weight:700; letter-spacing:.06em; color:var(--ink-faint); margin:0 0 9px; }
  /* 上：必ず選ぶ どの私／問いの立て方（2列で並べる＝1行に収める。各ピルは2段＝ラベル/値で、値が長くても崩れない） */
  .q-set2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:6px; }
  .q-set{ display:flex; flex-direction:column; align-items:flex-start; gap:1px; width:100%; min-width:0; padding:7px 13px; border-radius:14px; background:var(--surface); border:1px solid var(--line-strong); color:var(--ink-soft); font-size:12.5px; box-shadow:var(--shadow-sm); text-align:left; }
  .q-set .now{ color:var(--ink-faint); font-size:11px; font-weight:700; }
  .q-set-v{ display:inline-flex; align-items:center; gap:5px; max-width:100%; min-width:0; }
  .q-set strong{ color:var(--accent-ink); font-weight:800; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
  .q-set .c{ flex:none; color:var(--ink-faint); font-size:11px; }
  /* 主役：おまかせ大ボタン */
  .q-omakase{ width:100%; text-align:left; padding:20px 22px; border-radius:20px; background:var(--accent); color:var(--on-accent); box-shadow:var(--shadow-md); display:flex; align-items:center; gap:16px; }
  .q-omakase .ico{ flex:none; width:42px; height:42px; display:grid; place-items:center; opacity:.92; }
  .q-omakase .main{ flex:1; min-width:0; }
  .q-omakase .t{ display:block; font-size:18px; font-weight:600; }
  .q-omakase .s{ display:block; font-size:12.5px; opacity:.85; margin-top:3px; line-height:1.5; }
  .q-omakase .arr{ flex:none; font-size:22px; opacity:.8; }
  .q-or{ display:flex; align-items:center; gap:12px; margin:22px 0 14px; color:var(--ink-faint); font-size:12px; }
  .q-or::before,.q-or::after{ content:""; flex:1; height:1px; background:var(--line); }
  .q-topics{ display:flex; flex-wrap:wrap; gap:8px; }
  .q-topic{ padding:10px 16px; border-radius:999px; border:1px solid var(--line-strong); background:var(--surface); color:var(--ink); font-size:14px; }
  .q-topic.more{ border-style:dashed; color:var(--accent-ink); background:transparent; }


/* ===========================================================
   結果画面 新トーン（フラット＋砂/水・本人の言葉は明朝）2026-06
   既存 .result-* を上書き。グラデのヒーローを卒業。
   =========================================================== */
/* ===== 結果画面：青グラデのヒーローを卒業し、フラット＋砂/水の気配へ。本人の言葉は明朝。 ===== */
  .result-layout{ width:min(680px,100%); }
  /* ヒーロー：塗り→静かなフラット。砂紋をごく淡く敷く。 */
  .result-hero{ position:relative; overflow:hidden; background:transparent; color:var(--ink); box-shadow:none;
    border-radius:0; padding:clamp(10px,3vw,18px) 2px 6px; }
  .rh-sand{ position:absolute; inset:-6px 0 auto; width:100%; height:160px; pointer-events:none; opacity:.5; }
  .rh-sand path{ fill:none; stroke:var(--sand-line); stroke-width:1; }
  .result-hero .eyebrow{ color:var(--accent-ink); }
  .result-hero h1{ position:relative; margin:6px 0 12px; font-size:clamp(25px,5vw,33px); font-weight:400; line-height:1.4; letter-spacing:.01em; color:var(--ink); }
  .result-hero .lead{ position:relative; color:var(--ink-soft); font-size:15px; max-width:42ch; }
  /* サマリーカード：フラットなサーフェス＋ヘアライン。featured=accent / attention=rose。 */
  .summary-card{ background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-soft); border-radius:18px; padding:18px 18px 16px; }
  .summary-card h3{ color:var(--accent-ink); font-size:12px; font-weight:700; letter-spacing:.04em; }
  .summary-card p{ color:var(--ink); font-size:14.5px; line-height:1.75; }
  .summary-card.featured{ background:var(--accent-soft); border-color:transparent; }
  .summary-card.attention{ background:var(--rose-soft); border-color:transparent; }
  .summary-card.attention h3{ color:var(--rose); }
  /* 本人の言葉カード：明朝で別格・左にアクセント罫線（一次資料の保全） */
  .summary-card.words{ grid-column:1 / -1; background:var(--surface); border-color:var(--line); border-left:2px solid var(--accent); }
  .summary-card.words h3{ color:var(--accent-ink); }
  .summary-card.words p{ font-family:var(--font-mincho); font-size:16.5px; line-height:1.95; }
  /* Brief：そのまま静かなサーフェス（角丸を揃える） */
  .brief-panel,.next-panel{ background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-soft); border-radius:var(--r-lg); }
  .brief-textarea{ background:var(--bg); border:1px solid var(--line); border-radius:14px; }
  /* 使う：home の「つかう」と同じ"溜まった水面"。塗りヒーローではなく砂/水の地。 */
  .use-panel{ position:relative; overflow:hidden; background:var(--sand); border:0; border-radius:var(--r-lg);
    background-image:
      radial-gradient(135% 80% at 26% -14%, rgba(255,255,255,.20), transparent 56%),
      radial-gradient(120% 95% at 90% 120%, rgba(35,40,44,.05), transparent 60%); }
  .up-ripple{ position:absolute; right:-30px; bottom:-80px; width:340px; height:340px; pointer-events:none; }
  .up-ripple circle{ fill:none; stroke:var(--ripple-ring); stroke-width:1; vector-effect:non-scaling-stroke; }
  .use-panel > *{ position:relative; z-index:1; }
  .use-panel .eyebrow{ color:var(--accent-ink); }
  .use-panel h2{ font-weight:500; font-size:19px; color:var(--ink); }
  .use-panel .muted{ color:var(--ink-soft); }
  .use-actions .primary-button{ background:var(--accent); }
  .use-panel-divider{ border-top:1px dashed var(--line-strong); }
  .use-panel-divider a{ color:var(--accent-ink); }
  .next-panel h2{ font-weight:500; }


/* ===========================================================
   設定モーダル：モデル選択を選択カードへ（トーン統一）2026-06
   =========================================================== */
/* ===== 設定モーダル：モデル選択を、ドロップダウンから選択カードへ ===== */
  .modal-card h2{ font-weight:500; }
  .set-opts{ display:flex; flex-direction:column; gap:8px; margin:16px 0 4px; }
  .set-opt{ display:flex; align-items:flex-start; gap:12px; width:100%; padding:14px 16px; border-radius:14px;
            border:1px solid var(--line-strong); background:var(--surface); text-align:left;
            transition:border-color .15s var(--ease), background .15s var(--ease); }
  .set-opt:hover{ border-color:var(--accent); }
  .set-opt.on{ border-color:var(--accent); background:var(--accent-soft); }
  .set-opt-check{ flex:none; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--line-strong);
                  margin-top:1px; display:grid; place-items:center; color:#fff; }
  .set-opt.on .set-opt-check{ border-color:var(--accent); background:var(--accent); }
  .set-opt-check svg{ opacity:0; }
  .set-opt.on .set-opt-check svg{ opacity:1; }
  .set-opt-main{ flex:1; min-width:0; }
  .set-opt-name{ font-size:15px; font-weight:600; color:var(--ink); display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
  .set-opt-tag{ font-size:10.5px; font-weight:700; letter-spacing:.04em; color:var(--accent-ink); background:var(--surface); border:1px solid var(--accent); padding:2px 8px; border-radius:999px; }
  .set-opt.on .set-opt-tag{ background:#fff; }
  .set-opt-sub{ font-size:12.5px; color:var(--ink-soft); margin-top:3px; line-height:1.5; }
  .set-hint{ font-size:12px; color:var(--ink-faint); line-height:1.6; margin:0 2px 6px; }


/* ===========================================================
   相談デスク：青グラデのヒーローを卒業（結果画面と統一）2026-06
   =========================================================== */
/* ===== 相談デスク：青グラデのヒーローを卒業（結果画面と統一） ===== */
  .consult-hero{ position:relative; overflow:hidden; background:transparent; color:var(--ink); box-shadow:none; border-radius:0; padding:clamp(10px,3vw,18px) 2px 6px; }
  .consult-hero .rh-sand{ position:absolute; inset:-6px 0 auto; width:100%; height:150px; pointer-events:none; opacity:.5; }
  .consult-hero .rh-sand path{ fill:none; stroke:var(--sand-line); stroke-width:1; }
  .consult-hero .eyebrow{ color:var(--accent-ink); }
  .consult-hero h1{ position:relative; font-weight:400; font-size:clamp(24px,5vw,31px); color:var(--ink); margin:6px 0 12px; line-height:1.4; letter-spacing:.01em; }
  .consult-hero .lead{ position:relative; color:var(--ink-soft); font-size:14.5px; }
  .consult-hero strong{ color:var(--accent-ink); font-weight:700; }


/* ===========================================================
   相談デスク 作り込み（入力＝エディトリアル／確認＝静かな列）2026-06
   =========================================================== */
.consult-layout{ width:min(680px,100%); }
.consult-hero h1{ font-size:clamp(25px,5.4vw,33px); line-height:1.42; }
.consult-input-card{ background:transparent; border:0; box-shadow:none; padding:0; margin-top:6px; }
.consult-personas-label{ margin:0 0 9px; font-size:11px; font-weight:700; letter-spacing:.06em; color:var(--ink-faint); }
.persona-chip{ padding:8px 15px; background:transparent; color:var(--ink-soft); font-weight:500; }
.persona-chip:hover{ border-color:var(--accent); }
.consult-input-card .field > span{ font-size:13px; font-weight:600; color:var(--ink); }
.consult-question{ min-height:150px; padding:16px 18px; border-radius:18px; background:var(--surface); border:1px solid var(--line-strong); font-size:16px; line-height:1.75; box-shadow:var(--shadow-soft); }
.consult-question:focus{ border-color:var(--accent); }
.consult-actions .primary-button{ display:inline-flex; align-items:center; gap:9px; }
.consult-actions .primary-button .ico{ display:grid; place-items:center; }
.consult-cleared{ margin:2px 2px -2px; font-size:12.5px; color:var(--accent-ink); display:flex; align-items:center; gap:8px; }
.consult-cleared .dot{ width:7px; height:7px; border-radius:50%; background:var(--accent); }
.clarifying-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-soft); }
.clarifying-card .eyebrow{ color:var(--accent-ink); }
.clarifying-card > p.muted{ margin:4px 0 8px; font-size:13.5px; color:var(--ink-soft); }
.clarifying-item{ border-top:1px solid var(--line); }
.clarifying-item:first-of-type{ border-top:0; }
.clarifying-item strong{ color:var(--ink); font-weight:600; }
.clarifying-hint{ color:var(--ink-faint); }
.clarifying-answer{ background:var(--bg); border:1px solid var(--line); border-radius:12px; }
.clarifying-answer:focus{ border-color:var(--accent); }


/* ===========================================================
   対話の背景：ごく淡い干渉波（可読性優先）2026-06
   =========================================================== */
.chat-ripple{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:0; }
.chat-ripple circle{ fill:none; stroke:var(--accent); stroke-width:1.3; vector-effect:non-scaling-stroke; }
.chat-screen > .chat-main{ position:relative; z-index:1; }


/* ===========================================================
   取り込み振り分け：ヘッダー砂紋（結果・相談と統一）2026-06
   =========================================================== */
.unified-head{ position:relative; overflow:hidden; }
.unified-head > :not(.rh-sand){ position:relative; }
.sort-cat{ border-radius:var(--r-lg); box-shadow:var(--shadow-soft); }


/* ===========================================================
   ボトムシート：見出し付近に静かな波紋の気配（全シート共通）2026-06
   =========================================================== */
.menu-sheet-inner{ position:relative; }
.menu-sheet-inner > :not(.sheet-glow){ position:relative; }
.sheet-glow{ position:absolute; top:-26px; left:0; right:0; display:block; width:100%; max-width:100%; height:90px; overflow:hidden; pointer-events:none; opacity:.5; }
.sheet-glow circle{ fill:none; stroke:var(--ripple-ring); stroke-width:1; }

/* ===========================================================
   日記：書く（流れ式＝書く→問いを挟む→続けて書く…を積み上げ）2026-06
   =========================================================== */
/* 上＝これまでの塊＋問い（スクロール）／下＝深掘りボタン＋バー（固定）。 */
.jw-scroll{ flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; overflow-anchor:none; }
.jw-flow{ display:flex; flex-direction:column; gap:14px; padding:4px 0 6px; }
.jw-flow:empty{ display:none; }
/* これまで書いた塊（あなたの言葉）。確定済みの落ち着いた見え方。 */
.jw-flow-you{ font-size:16px; line-height:1.95; color:var(--ink); white-space:pre-wrap; word-break:break-word; }
/* 挟んだ問い（深掘り）。あなたの言葉と区別＝控えめなアクセント。 */
.jw-flow-q{ position:relative; padding:12px 15px; border-radius:13px; background:var(--accent-soft); color:var(--accent-ink); font-size:14px; line-height:1.7; }
/* ★z236：答え待ちの深掘り問いカードの右上に出る「この問いをやめる」×ボタン。
   既存の下バー「問いをやめる」と同じ動線を、カードからも直感的に呼べるようにする。
   タップターゲットは44px以上を確保（モバイル）。視覚的には控えめ＝邪魔しない・hoverで濃く。 */
.jw-flow-q-x{ position:absolute; top:4px; right:6px; min-width:36px; min-height:36px;
              display:inline-flex; align-items:center; justify-content:center;
              background:transparent; border:0; cursor:pointer;
              color:var(--accent-ink); opacity:.55; font-size:18px; line-height:1; padding:0;
              border-radius:50%; }
.jw-flow-q-x:hover{ opacity:1; background:rgba(0,0,0,0.04); }
.jw-flow-q-x:focus-visible{ outline:2px solid var(--accent-ink); outline-offset:2px; opacity:1; }
.jw-flow-q.is-loading{ opacity:.7; }
/* textarea は「いま書いている塊」＝紙の中の続き。画面の残り高さを埋める別箱にしない。
   ★z242：「---線の上・線・下」を1枚の紙として扱うため、flexで伸縮させず、内容ぶんだけ高さを持たせる。
   高さは JS の growJournalArea() が requestAnimationFrame 経由で scrollHeight に追従させる。
   唯一のスクロール容器は .jw-scroll。--- はただの区切り線で、別スクロール領域の境界ではない。
   z238 で副作用が出た末尾追従ロジックは入れない。 */
.jw-area{ flex:0 0 auto; min-height:160px; box-sizing:border-box; overflow:hidden; resize:none; }
.jw-flow:not(:empty) + .jw-area{ padding-top:10px; border-top:1px dashed var(--line); margin-top:4px; }

/* 受け取り：挟んだ問いを織り込んで見せる（あなたの言葉は明朝・問いは控えめUIフォント）。 */
.ja-entry-q{ margin:14px 0 12px; font-family:var(--font-ui); font-size:13px; line-height:1.7; color:var(--accent-ink); }
.ja-entry-q .jw-depth-tag{ display:inline-block; margin-right:8px; }

/* ===========================================================
   日記：書く＝スレッド化（問いを差し込む・問い待ち強調・問いを変える/やめる）＋背景の水面＋マイク 2026-06
   =========================================================== */
/* 背景：水面の干渉波（対話と同じ）。本文は前面に。 */
.jw{ position:relative; }
.jw > .chat-ripple{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:0; }
.jw > *:not(.chat-ripple){ position:relative; z-index:1; }

/* いま答え待ちの問い＝強調（答えたか分かる）。答え済みの問いは控えめ（上の .jw-flow-q のまま）。 */
.jw-flow-q.is-current{ box-shadow:0 0 0 1.5px var(--accent-soft), 0 0 0 1px var(--ripple-ring); }
.jw-flow-q.is-current .jw-depth-tag{ color:var(--accent-ink); opacity:1; }
.jw-flow-q.is-loading{ opacity:.7; }

/* 深掘りコントロール（#journalDepth）：通常＝1ボタン／問い待ち＝答えてつぎへ＋小さな2択 */
.jw-depth{ flex:none; display:flex; flex-direction:column; gap:8px; align-items:flex-start; padding:8px 0 4px; }
.jw-depth-btn{ display:inline-flex; align-items:center; gap:8px; padding:9px 15px; border-radius:999px; background:transparent;
               border:1px solid var(--line-strong); color:var(--ink-soft); font-size:13.5px;
               transition:border-color .15s var(--ease), color .15s var(--ease); }
.jw-depth-btn:hover{ border-color:var(--accent); color:var(--accent-ink); }
.jw-depth-btn:disabled{ opacity:.55; }
.jw-depth-alts{ display:flex; gap:14px; padding-left:4px; }
.jw-depth-alt{ background:none; border:0; color:var(--ink-faint); font-size:12.5px; padding:2px 2px; text-decoration:underline; text-underline-offset:3px; }
.jw-depth-alt:hover{ color:var(--accent-ink); }

/* マイク：録音中はaccentで満たし、やさしく明滅（対話のマイクと同じ作法＝オンが分かる）。 */
.jw-mic.recording{ background:var(--accent); color:var(--on-accent); border-color:var(--accent); animation:micPulse 1.25s var(--ease) infinite; }

/* バー：ヒント（左・flex）→マイク→残す（右）。右手の親指で押しやすい位置にマイクと残すを寄せる。 */
/* 深掘りコントロールを下のバーの左（旧ヒントの位置）に置く＝常時アクセス可・通常時はバーの高さ(mic46px)に収まる。 */
.jw-bar .jw-depth{ flex:1; order:0; flex-direction:row; flex-wrap:wrap; align-items:center; gap:6px 12px; padding:0; min-width:0; }
/* ボタンの文字は1行固定＝小さい画面（iPhone SE等）で「深掘りの問いをもらう」が2段に折れない（作者FB 2026-06-13）。 */
.jw-bar .jw-depth-btn{ white-space:nowrap; }
@media (max-width: 400px){
  .jw-bar{ gap:8px; }
  .jw-bar .jw-depth-btn{ font-size:12px; padding:8px 10px; gap:5px; }
}
.jw-bar .jw-mic{ order:1; }
.jw-bar .jw-save{ order:2; }

/* ===========================================================
   日記の実機FB追補：処理中表示・戻って編集・塊の編集・「答える」 2026-06
   =========================================================== */
/* ②受け取り：そっと見えてきたこと の処理中＝点が流れて「処理中」と分かる */
.ja-noticed-loading{ display:flex; align-items:center; gap:10px; color:var(--accent-ink); font-size:12.5px; line-height:1.6; }
.ja-noticed-loading .thinking-dots{ flex:none; }

/* ④受け取り：戻って編集（フッターを2段に：戻って編集（リンク）／いまのあなたを見る・とじる） */
.ja-foot{ flex-direction:column; align-items:stretch; gap:10px; }
.ja-foot-top{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ja-edit{ background:none; border:0; color:var(--ink-soft); font-size:13px; padding:2px 2px; }
.ja-edit:hover{ color:var(--accent-ink); }
/* この日記を削除：戻って編集の反対側に控えめに（中和臙脂） */
.ja-del{ background:none; border:0; color:var(--rose-ink); font-size:13px; opacity:.82; padding:2px 2px; cursor:pointer; }
.ja-del:hover{ opacity:1; text-decoration:underline; }
.ja-foot-main{ display:flex; gap:9px; width:100%; }

/* ④書く画面：あなたの言葉の塊を、その場で直接書き換える（別モード・取消/直す は無い） */
.jw-flow-you-edit{ position:relative; }
/* ★最初に書く時の入力欄(.jw-area)と同じ手触り＝常に背景そのまま（透明）・枠なし・フォーカスしても白い箱にしない。 */
/*   font-size/line-height も composer(17px/2) に揃える＝「編集」でなく「そのまま書き換える」感触。× のぶんだけ右に余白。 */
.jw-flow-edit{ width:100%; box-sizing:border-box; border:0; background:transparent; color:var(--ink);
               font-family:var(--font-ui); font-size:17px; line-height:2; padding:2px 26px 2px 0; resize:none; outline:none; overflow:hidden; cursor:text;
               white-space:pre-wrap; word-break:break-word; }
/* 各塊の控えめな×（右上）。誤タップしにくいよう小さく薄く・打鍵域(padding-right)と分離。 */
.jw-flow-x{ position:absolute; top:3px; right:3px; width:22px; height:22px; line-height:1; background:none; border:0; color:var(--ink-faint); font-size:15px; opacity:.4; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.jw-flow-x:hover, .jw-flow-x:focus{ opacity:1; color:var(--rose-ink); }
/* z222 UX修正：見た目は22pxのまま、実質タップ域を44pxに広げる（iOS HIG準拠・誤タップ低減）。 */
.jw-flow-x::before{ content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:44px; height:44px; }
.jw-flow-q{ cursor:default; }

/* ①「答える」＝答えを確定するだけ（深掘りは任意）。深掘りボタン(枠線)と区別＝控えめな塗り。 */
.jw-depth-btn.jw-answer{ background:var(--accent-soft); border-color:transparent; color:var(--accent-ink); font-weight:600; }
.jw-depth-btn.jw-answer:hover{ background:var(--accent-soft); border-color:var(--accent); }

/* ===========================================================
   はじめてのガイド（オンボーディング #guide）2026-06-07
   ハイブリッド＝禅トーンの短いカード→1問だけ味見→4つの入口。
   作法は .ja（受け取り画面）に揃える：min-height100%のflex列＋footはmargin-top:auto。
   =========================================================== */
.guide{ position:relative; width:min(540px,100%); max-width:100%; min-width:0; box-sizing:border-box; margin:0 auto; min-height:100%; display:flex; flex-direction:column;
        padding:clamp(10px,3vw,18px) clamp(20px,5vw,30px) calc(env(safe-area-inset-bottom) + 22px); overflow:hidden; overscroll-behavior-x:none; touch-action:pan-y; }
  /* 背景の波紋（少しだけ濃く＝「居る」と分かるくらい。操作の邪魔はしない） */
  .guide-ripple{ position:absolute; inset:0; width:100%; max-width:100%; height:100%; z-index:0; pointer-events:none;
                 fill:none; stroke:var(--accent); stroke-width:1.1; opacity:.82; }
  .guide > :not(.guide-ripple){ position:relative; z-index:1; }
  /* 上部：進捗ドットのみ（とじるは廃止＝全員に読んでもらう）。中央寄せ。 */
  .guide-top{ flex:none; min-width:0; max-width:100%; display:flex; align-items:center; justify-content:center; gap:12px; padding:6px 0 2px; }
  /* 進捗ドット（ステップ数が多いので小さめ＝12個でも横に収まる） */
  .guide-dots{ display:flex; align-items:center; justify-content:center; gap:5px; flex-wrap:wrap; }
  .guide-dot{ width:5px; height:5px; border-radius:999px; background:var(--line-strong); transition:all .25s var(--ease); }
  .guide-dot.done{ background:var(--accent-soft); }
  .guide-dot.on{ width:15px; background:var(--accent); }
  /* 本文 */
  .guide-body{ flex:0 1 auto; min-width:0; max-width:100%; padding-top:clamp(18px,6vh,40px); overflow-x:hidden; }
  .guide-eyebrow{ font-size:11px; font-weight:700; letter-spacing:.22em; color:var(--ink-faint); margin:0 0 14px; }
  /* 見出しはアプリ標準（.ja-h/.q-h＝clamp(24,7vw,28)）に揃える＝中途半端な折り返しを避けつつ世界観を統一。 */
  .guide-title{ margin:0; font-size:clamp(24px,7vw,28px); font-weight:400; line-height:1.5; letter-spacing:.02em; color:var(--ink); overflow-wrap:anywhere; }
  .guide-visual{ margin:20px 0 0; border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden;
                 background:linear-gradient(180deg, rgba(243,245,246,.72), rgba(233,236,237,.42));
                 box-shadow:inset 0 1px 0 rgba(255,255,255,.55); }
  .guide-visual-svg{ display:block; width:100%; height:auto; min-height:118px; }
  .guide-visual .gv-line,
  .guide-visual .gv-water,
  .guide-visual .gv-ring,
  .guide-visual .gv-branch,
  .guide-visual .gv-rise,
  .guide-visual .gv-drop,
  .guide-visual .gv-arrow{ stroke:var(--accent); stroke-width:1.35; stroke-linecap:round; stroke-linejoin:round; opacity:.62; }
  .guide-visual .gv-line.faint,
  .guide-visual .gv-ring.faint{ opacity:.22; }
  .guide-visual .gv-water{ opacity:.36; }
  .guide-visual .gv-paper,
  .guide-visual .gv-card,
  .guide-visual .gv-bubble,
  .guide-visual .gv-node,
  .guide-visual .gv-stepbox,
  .guide-visual .gv-answer{ fill:rgba(243,245,246,.78); stroke:var(--line-strong); stroke-width:1.2; }
  .guide-visual .gv-ice-tip{ fill:rgba(243,245,246,.82); stroke:var(--accent); stroke-width:1.2; opacity:.72; }
  .guide-visual .gv-ice-base{ fill:rgba(90,117,133,.10); stroke:var(--accent); stroke-width:1.2; opacity:.72; }
  .guide-visual .gv-card,
  .guide-visual .gv-paper,
  .guide-visual .gv-stepbox{ filter:drop-shadow(0 8px 16px rgba(35,40,44,.06)); }
  .guide-visual .gv-step-label{ fill:var(--accent-ink); font-family:var(--font-ui); font-size:13px; font-weight:700; letter-spacing:.04em; }
  .guide-visual .gv-mark{ stroke:var(--ink-soft); stroke-width:1.25; stroke-linecap:round; opacity:.58; }
  .guide-visual .gv-dot,
  .guide-visual .gv-core{ fill:var(--accent); opacity:.46; }
  .guide-visual .gv-dot.strong,
  .guide-visual .gv-core{ opacity:.82; }
  .guide-lead{ margin:20px 0 0; color:var(--ink-soft); font-size:15px; line-height:1.9; overflow-wrap:anywhere; }
  .guide-lead em{ font-style:normal; font-weight:600; color:var(--accent-ink); }
  .guide-note{ margin:18px 0 0; color:var(--ink-faint); font-size:13px; line-height:1.8; overflow-wrap:anywhere; }
  /* 味見（1問だけ） */
  .guide-taste-q{ margin:22px 0 0; font-size:16.5px; line-height:1.8; color:var(--ink); overflow-wrap:anywhere; }
  .guide-taste-box{ margin:18px 0 0; min-width:0; max-width:100%; overflow-x:hidden; }
  .guide-taste-input{ width:100%; max-width:100%; min-height:96px; padding:14px 16px; border-radius:var(--r-md); background:var(--surface);
                      border:1px solid var(--line-strong); color:var(--ink); font-family:var(--font-ui); font-size:16px;
                      line-height:1.8; resize:none; box-shadow:var(--shadow-sm); overflow-x:hidden; }
  .guide-taste-input:focus{ outline:none; border-color:var(--accent); }
  /* 入力欄の下のひとこと（「整えなくて、大丈夫。」）＝書く前の不安をほどく小さな声 */
  .guide-taste-hint{ margin:10px 2px 0; font-size:12.5px; line-height:1.7; color:var(--ink-faint); }
  /* 「答える」は右寄せ（作者FB 2026-06-13＝左にあると落ち着かない）。fit-content＋margin-left:auto で右へ。 */
  .guide-taste-submit{ display:block; margin:14px 0 0 auto; width:fit-content; min-height:46px; padding:12px 26px; border-radius:999px; background:var(--accent);
                       color:var(--on-accent); font-size:14.5px; font-weight:600; box-shadow:var(--shadow-sm); }
  .guide-taste-you{ padding:2px 0 0 15px; border-left:2px solid var(--line-strong); font-family:var(--font-mincho);
                    font-size:16px; line-height:1.95; color:var(--ink); overflow-wrap:anywhere; }
  .guide-taste-reply{ margin:18px 0 0; padding:16px 18px; border-radius:var(--r-lg); background:var(--accent-soft);
                      color:var(--ink); font-size:14.5px; line-height:1.85; overflow-wrap:anywhere; }
  .guide-taste-reply.loading{ display:flex; align-items:center; gap:10px; color:var(--accent-ink); }
  .guide-taste-seed{ margin:16px 0 0; font-size:12.5px; line-height:1.75; color:var(--accent-ink); opacity:.9; overflow-wrap:anywhere; }
  /* 登録壁の直前カード「あなたの文脈が、AIの答えを変える。」（z389・登録前ガイド専用）
     文章で説明せず実物と対比で見せる：上＝本人の答えがカード化された実物（「たまる」の証拠）／
     下＝固定例文のビフォーアフター（グレー=一般論・accent=あなた向け。読まなくても色と形で優劣が伝わる） */
  .pre-why-card{ margin:20px 0 0; padding:12px 15px; border-radius:var(--r-md); background:var(--surface); border:1px solid var(--line-strong); box-shadow:var(--shadow-sm); }
  .pre-why-card-label{ margin:0 0 5px; font-size:11px; letter-spacing:.06em; color:var(--accent-ink); font-weight:600; }
  .pre-why-card-words{ margin:0; font-family:var(--font-mincho); font-size:14.5px; line-height:1.85; color:var(--ink); overflow-wrap:anywhere; }
  .pre-why-cap{ margin:8px 2px 0; font-size:12px; line-height:1.7; color:var(--ink-faint); }
  .pre-why-q{ margin:22px 2px 0; font-size:13px; font-weight:600; color:var(--ink-soft); }
  .pre-why-bubble{ margin:10px 0 0; padding:11px 14px; border-radius:14px 14px 14px 4px; font-size:13.5px; line-height:1.8; overflow-wrap:anywhere; }
  .pre-why-tag{ display:block; margin:0 0 3px; font-size:11px; font-weight:600; }
  .pre-why-bubble.none{ background:var(--surface-2); color:var(--ink-soft); border:1px solid var(--line); }
  .pre-why-bubble.none .pre-why-tag{ color:var(--ink-faint); }
  .pre-why-bubble.with{ background:var(--accent); color:var(--on-accent); }
  .pre-why-bubble.with .pre-why-tag{ color:var(--on-accent); opacity:.78; }
  .pre-why-close{ margin:12px 2px 0; font-size:12.5px; line-height:1.7; color:var(--ink-soft); }
  /* 4つの入口 */
  .guide-ways{ list-style:none; margin:22px 0 0; padding:0; display:flex; flex-direction:column; gap:4px; }
  .guide-way{ display:flex; align-items:flex-start; gap:14px; padding:13px 4px; }
  .guide-way + .guide-way{ border-top:1px solid var(--line); }
  .guide-way-ico{ flex:none; width:34px; height:34px; display:grid; place-items:center; color:var(--accent-ink); opacity:.9; }
  .guide-way-ico svg{ width:30px; height:30px; }
  .guide-way-main{ flex:1; min-width:0; }
  .guide-way-label{ display:block; font-size:15px; font-weight:600; color:var(--ink); overflow-wrap:anywhere; }
  .guide-way-desc{ display:block; margin-top:3px; font-size:13px; line-height:1.6; color:var(--ink-soft); overflow-wrap:anywhere; }
  /* フッター（左もどる／右つぎへ・はじめる） */
  .guide-foot{ flex:none; min-width:0; max-width:100%; margin-top:auto; padding-top:24px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .guide-foot-spacer{ flex:1; }
  .guide-back{ background:none; border:0; color:var(--ink-soft); font-size:14px; padding:10px 4px; }
  .guide-back:hover{ color:var(--ink); }
  .guide-next{ min-height:48px; padding:13px 34px; border-radius:999px; background:var(--accent); color:var(--on-accent);
               font-size:15px; font-weight:600; box-shadow:var(--shadow-md); }
  .guide-next:disabled{ opacity:.5; }

/* ガイド：見出し＋説明文の箇条書き（育てる・持ち出す＝STEP11）と、最終ステップの小さな注意書き（2026-06-07 拡張） */
  .guide-points{ list-style:none; margin:22px 0 0; padding:0; display:flex; flex-direction:column; gap:2px; }
  .guide-point{ display:flex; flex-direction:column; gap:5px; padding:14px 2px; }
  .guide-point + .guide-point{ border-top:1px solid var(--line); }
  .guide-point-label{ font-size:14.5px; font-weight:600; color:var(--accent-ink); overflow-wrap:anywhere; }
  .guide-point-desc{ font-size:13.5px; line-height:1.8; color:var(--ink-soft); overflow-wrap:anywhere; }
  .guide-caution{ margin:18px 0 0; padding:12px 14px; border-radius:var(--r-sm); background:var(--surface);
                  border:1px solid var(--line); color:var(--ink-faint); font-size:12px; line-height:1.78; overflow-wrap:anywhere; }

/* プライバシーについて（ボトムシート）＋ガイド最終ページの導線リンク（2026-06-07） */
  .privacy-lead{ margin:0 6px 6px; font-size:13.5px; line-height:1.85; color:var(--ink-soft); }
  .privacy-h{ margin:20px 6px 8px; font-size:14px; font-weight:700; letter-spacing:.01em; color:var(--ink); }
  .privacy-p{ margin:0 6px 9px; font-size:13.5px; line-height:1.9; color:var(--ink-soft); }
  .privacy-p em{ font-style:normal; font-weight:600; color:var(--accent-ink); }
  .privacy-bullets{ margin:4px 6px 9px; padding-left:1.3em; }
  .privacy-bullets li{ font-size:13.5px; line-height:1.85; color:var(--ink-soft); }
  .privacy-note{ margin:20px 6px 0; font-size:12px; color:var(--ink-faint); }
  .privacy-close{ margin:22px 6px 6px; width:calc(100% - 12px); min-height:46px; border-radius:14px;
                  background:var(--surface-2); border:1px solid var(--line-strong); color:var(--ink-soft); font-size:14px; font-weight:600; }
  /* ガイド本文内の控えめなテキストリンク（プライバシーへ） */
  .guide-link{ display:inline-block; margin:18px 0 0; padding:6px 0; background:none; border:0;
               color:var(--accent-ink); font-size:13.5px; font-weight:600; text-align:left; }
  .guide-link:hover{ color:var(--accent-press); }

/* ガイド：用語＝説明の段組み（問いの2択／コンテキストの三層を読みやすく）2026-06-08 */
  .guide-defs{ list-style:none; margin:16px 0 4px; padding:0; display:flex; flex-direction:column; gap:13px; }
  .guide-def{ padding-left:14px; border-left:2px solid var(--line-strong); }
  .guide-def-t{ display:block; font-size:14.5px; font-weight:600; color:var(--accent-ink); }
  .guide-def-d{ display:block; margin-top:3px; font-size:13.5px; line-height:1.7; color:var(--ink-soft); }

/* AIへの送信の同意シート（送信直前に1回）＋プライバシーシートの同意トグル（2026-06-08・Apple 5.1.2(i)） */
  .consent-inner{ padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
  .consent-title{ margin:6px 6px 0; font-size:clamp(18px,5vw,21px); font-weight:600; line-height:1.5; color:var(--ink); }
  .consent-body{ margin:12px 6px 0; font-size:14px; line-height:1.9; color:var(--ink-soft); }
  .consent-body em{ font-style:normal; font-weight:600; color:var(--accent-ink); }
  .consent-link{ display:inline-block; margin:14px 6px 0; padding:6px 0; background:none; border:0; color:var(--accent-ink); font-size:13.5px; font-weight:600; text-align:left; }
  .consent-link:hover{ color:var(--accent-press); }
  .consent-actions{ display:flex; flex-direction:column; gap:10px; margin:20px 6px 0; }
  .consent-agree{ width:100%; min-height:50px; border-radius:14px; background:var(--accent); color:var(--on-accent); font-size:15px; font-weight:600; box-shadow:var(--shadow-md); }
  .consent-decline{ width:100%; min-height:46px; border-radius:14px; background:var(--surface-2); border:1px solid var(--line-strong); color:var(--ink-soft); font-size:14px; font-weight:600; }
  .consent-foot{ margin:16px 6px 0; font-size:12px; line-height:1.7; color:var(--ink-faint); text-align:center; }
  /* プライバシーシート内のトグル */
  .privacy-consent{ margin:6px 6px 4px; padding:12px 14px; border-radius:var(--r-md); background:var(--surface-2); border:1px solid var(--line); }
  .privacy-consent .setting-toggle{ font-weight:600; }
  .privacy-consent-note{ margin:6px 0 0; font-size:12px; line-height:1.7; color:var(--ink-faint); }

  /* 夜トーン：固定の白っぽい図解・小部品を、共通トークンへ戻す。 */
  :root[data-theme="yoru"] .use-panel,
  :root[data-theme="night"] .use-panel,
  :root[data-theme="dark"] .use-panel {
    background: var(--sand);
    background-image:
      radial-gradient(135% 80% at 26% -14%, rgba(155, 182, 196, 0.10), transparent 56%),
      radial-gradient(120% 95% at 90% 120%, rgba(5, 10, 14, 0.18), transparent 60%);
    border: 1px solid var(--line);
  }
  :root[data-theme="yoru"] .guide-visual,
  :root[data-theme="night"] .guide-visual,
  :root[data-theme="dark"] .guide-visual {
    background: linear-gradient(180deg, rgba(31, 42, 50, 0.76), rgba(24, 34, 42, 0.46));
    box-shadow: inset 0 1px 0 rgba(218, 235, 242, 0.07);
  }
  :root[data-theme="yoru"] .guide-visual .gv-paper,
  :root[data-theme="yoru"] .guide-visual .gv-card,
  :root[data-theme="yoru"] .guide-visual .gv-bubble,
  :root[data-theme="yoru"] .guide-visual .gv-node,
  :root[data-theme="yoru"] .guide-visual .gv-stepbox,
  :root[data-theme="yoru"] .guide-visual .gv-answer,
  :root[data-theme="night"] .guide-visual .gv-paper,
  :root[data-theme="night"] .guide-visual .gv-card,
  :root[data-theme="night"] .guide-visual .gv-bubble,
  :root[data-theme="night"] .guide-visual .gv-node,
  :root[data-theme="night"] .guide-visual .gv-stepbox,
  :root[data-theme="night"] .guide-visual .gv-answer,
  :root[data-theme="dark"] .guide-visual .gv-paper,
  :root[data-theme="dark"] .guide-visual .gv-card,
  :root[data-theme="dark"] .guide-visual .gv-bubble,
  :root[data-theme="dark"] .guide-visual .gv-node,
  :root[data-theme="dark"] .guide-visual .gv-stepbox,
  :root[data-theme="dark"] .guide-visual .gv-answer {
    fill: rgba(31, 42, 50, 0.82);
  }
  :root[data-theme="yoru"] .guide-visual .gv-ice-tip,
  :root[data-theme="night"] .guide-visual .gv-ice-tip,
  :root[data-theme="dark"] .guide-visual .gv-ice-tip {
    fill: rgba(155, 182, 196, 0.16);
  }
  :root[data-theme="yoru"] .set-opt.on .set-opt-tag,
  :root[data-theme="night"] .set-opt.on .set-opt-tag,
  :root[data-theme="dark"] .set-opt.on .set-opt-tag {
    background: var(--surface-2);
  }
  :root[data-theme="yoru"] .notification-slot,
  :root[data-theme="night"] .notification-slot,
  :root[data-theme="dark"] .notification-slot,
  :root[data-theme="yoru"] #paywallDiagnosticCopyBtn,
  :root[data-theme="night"] #paywallDiagnosticCopyBtn,
  :root[data-theme="dark"] #paywallDiagnosticCopyBtn {
    background: var(--surface) !important;
    color: var(--ink-soft) !important;
    border-color: var(--line-strong) !important;
  }

  /* ============ 画面の文脈内ガイド（初回1枚カード）＝ガイドと同じ霧の意匠 ============ */
  /* 各画面を最初に開いた瞬間に1度だけ重ねる（maybeShowScreenHint）。背景タップでも閉じる＝閉じ込めない。 */
  /* ★カード内のトークンは霧の値に固定＝#context の夜トーン（data-ctx-toneが--ink等を上書き）でも、明るいカードの文字が薄くならない */
  .hint-overlay{ position:fixed; inset:0; z-index:1200; display:flex; align-items:center; justify-content:center;
                 padding:24px 20px calc(24px + env(safe-area-inset-bottom)); background:rgba(36, 44, 49, .32);
                 -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); animation:hintFade .24s ease;
                 --ink:#23282c; --ink-faint:#9aa4ac; --accent:#5a7585; --accent-ink:#456072; --on-accent:#ffffff; }
  .hint-card{ width:min(480px, 100%); max-height:80vh; overflow:auto; border-radius:20px; padding:30px 26px 24px;
              background:linear-gradient(170deg, #eef1f3, #f7f9fa); box-shadow:0 18px 48px rgba(31, 41, 46, .22);
              animation:hintRise .26s ease; }
  .hint-title{ margin:0; font-size:23px; line-height:1.55; font-weight:500; color:var(--ink); letter-spacing:.02em; }
  .hint-body{ margin:14px 0 0; font-size:14.5px; line-height:1.95; color:var(--ink); }
  .hint-title em, .hint-body em, .hint-note em{ font-style:normal; color:var(--accent-ink); }
  .hint-note{ margin:16px 0 0; font-size:12.5px; line-height:1.8; color:var(--ink-faint); }
  .hint-credit{ display:block; margin:16px 0 0; padding:0; background:none; border:none; font-size:12.5px;
                color:var(--accent-ink); text-align:left; line-height:1.7; }
  .hint-close{ display:block; margin:22px 0 0 auto; min-height:44px; padding:11px 30px; border-radius:999px;
               background:var(--accent); color:var(--on-accent); font-size:14px; font-weight:600; box-shadow:var(--shadow-sm); }
  .hint-overlay.out{ opacity:0; transition:opacity .2s ease; }
  @keyframes hintFade{ from{ opacity:0; } }
  @keyframes hintRise{ from{ opacity:0; transform:translateY(10px); } }

  /* ============ アプリ内の確認ダイアログ（confirmModal）＝window.confirmの置き換え（ブラウザの「ダイアログを表示しない」を消す） ============ */
  .confirm-overlay{ position:fixed; inset:0; z-index:1300; display:flex; align-items:center; justify-content:center;
                    padding:24px 20px calc(24px + env(safe-area-inset-bottom)); background:rgba(36, 44, 49, .34);
                    -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); animation:hintFade .2s ease;
                    --ink:#23282c; --ink-faint:#9aa4ac; }
  .confirm-card{ width:min(420px, 100%); border-radius:18px; padding:26px 24px 20px; background:#f7f9fa;
                 box-shadow:0 18px 48px rgba(31, 41, 46, .24); animation:hintRise .22s ease; }
  .confirm-title{ margin:0; font-size:18px; line-height:1.6; font-weight:500; color:var(--ink); }
  .confirm-body{ margin:12px 0 0; font-size:14px; line-height:1.85; color:var(--ink); }
  .confirm-actions{ display:flex; justify-content:flex-end; gap:10px; margin:22px 0 0; }
  .confirm-cancel{ min-height:44px; padding:11px 20px; border-radius:999px; background:transparent; border:1px solid #cdd4d8;
                   color:#46525a; font-size:14px; }
  .confirm-ok{ min-height:44px; padding:11px 22px; border-radius:999px; background:#5a7585; border:0; color:#fff; font-size:14px; font-weight:600; }
  .confirm-ok.danger{ background:#b4584f; } /* 取り消せない削除＝落ち着いた赤茶（煽らないが「戻れない」が伝わる） */
  .confirm-overlay.out{ opacity:0; transition:opacity .16s ease; }

  /* ============ ホーム・スポットライトツアー（オンボ直後・一度きり） ============ */
  /* overlay＝全画面で操作を遮る（透明・暗さは spot の box-shadow が作る）。menu-sheet(z60)より上＝メニュー段でも上から照らす。
     touch-action:none＝ツアー中はページをスクロールさせない＝対象/吹き出しが指の下で動かない（もどるが押せない問題の一因の解消）。 */
  .tour-overlay{ position:fixed; inset:0; z-index:1150; touch-action:none; animation:hintFade .24s ease;
                 --ink:#23282c; --ink-faint:#9aa4ac; --accent:#5a7585; --on-accent:#fff; }
  .tour-overlay.out{ opacity:0; transition:opacity .18s ease; }
  /* spot＝対象の周りだけ明るく、外側は box-shadow で暗くする。やわらかい白い輪＋ゆっくり明滅。
     ★位置のtransitionは付けない＝tourReglue がスクロール中も即座に対象へ貼り直すため（付けると遅れて"ズレて"見える）。 */
  .tour-spot{ position:fixed; border-radius:14px; pointer-events:none;
              box-shadow:0 0 0 9999px rgba(36, 44, 49, .58), 0 0 0 2px rgba(255,255,255,.55);
              animation:tourPulse 2s var(--ease) infinite; }
  @keyframes tourPulse{ 0%,100%{ box-shadow:0 0 0 9999px rgba(36,44,49,.58), 0 0 0 2px rgba(255,255,255,.5); }
                        50%{ box-shadow:0 0 0 9999px rgba(36,44,49,.58), 0 0 0 5px rgba(255,255,255,.28); } }
  /* 吹き出し＝左右16pxで全幅・縦だけ対象の上/下（tourReglueが top を計算）。 */
  .tour-callout{ position:fixed; left:16px; right:16px; max-width:440px; margin:0 auto; padding:18px 20px 16px;
                 border-radius:16px; background:#f7f9fa; box-shadow:0 14px 40px rgba(31,41,46,.28); animation:hintRise .26s ease; }
  .tour-skip{ position:absolute; top:12px; right:14px; background:none; border:0; padding:6px 4px; font-size:12.5px; color:var(--ink-faint); }
  .tour-count{ margin:0; font-size:11px; letter-spacing:.08em; color:var(--ink-faint); }
  .tour-title{ margin:6px 0 0; font-size:18px; line-height:1.5; font-weight:500; color:var(--ink); }
  .tour-title em, .tour-body em{ font-style:normal; color:var(--accent-ink, #456072); }
  .tour-body{ margin:8px 0 0; font-size:14px; line-height:1.85; color:var(--ink); }
  .tour-actions{ display:flex; align-items:center; justify-content:space-between; margin:16px 0 0; }
  .tour-back{ background:none; border:0; padding:8px 4px; font-size:13.5px; color:var(--ink-soft, #5a6770); }
  .tour-foot-spacer{ flex:0 0 auto; }
  .tour-next{ min-height:42px; padding:10px 24px; border-radius:999px; background:var(--accent); border:0; color:var(--on-accent); font-size:14px; font-weight:600; box-shadow:var(--shadow-sm); }

/* =========================================================
   アンビエントモード（z317）：全画面にエフェクトだけを流す。
   メニュー「アプリ ＞ アンビエントモード」で入り、画面タップ（またはEsc）で戻る。
   UI（app-shell）はふわっと消すだけ＝アプリの状態はそのまま保つ。
   ★このブロックはファイル末尾に置く＝ body.context-screen #ambientCanvas { display:none }（同じ詳細度）より
     後方に来て、コンテキスト画面からでも全画面エフェクトに入れるようにする。
   ========================================================= */
body.ambient-zen .app-shell {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
body.ambient-zen #ambientCanvas {
  display: block;
}
/* 「画面をタップで戻る」の一時ヒント（入った直後だけふわっと出て消える）。
   ★色はトークンでなく霧の実値で固定＝夜トーンのコンテキスト画面から入っても、
     背後のキャンバス（常に明色の霧地）の上で読める（z317レビュー対応）。 */
.ambient-zen-hint {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 34px);
  transform: translateX(-50%);
  z-index: 5;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(243, 245, 246, 0.75);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #6c7780;
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.ambient-zen-hint.show {
  opacity: 1;
}
/* 夜トーン時のヒント（背景が暗いので暗地＋明文字に反転・z319） */
body.ambient-zen.ambient-yoru .ambient-zen-hint {
  background: rgba(30, 40, 48, 0.75);
  color: #b0c0cc;
}
/* アンビエントモード中のワードマーク（z353・作者実験）：美しい瞬間のスクショが共有された時に
   「これは何のアプリか」が伝わる控えめな刻印。トップバーの .brand と同じ組み（11px・字間0.38em・大文字）。
   色はヒントと同じ理由でトークンでなく実値固定（キャンバスの実際の地色に合わせる）。常時表示＝操作UIではないので消えない。 */
.ambient-zen-brand {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 22px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.38em;
  padding-left: 0.38em; /* 字間の末尾分を相殺し、見た目を中央へ（.brand と同じ） */
  text-transform: uppercase;
  color: rgba(108, 119, 128, 0.13); /* 霧地の #6c7780 の極薄透かし（z355で.24→z357でさらに半減・作者FB「もっと薄く」） */
  white-space: nowrap;
  pointer-events: none;
  display: none;
}
body.ambient-zen .ambient-zen-brand {
  display: block;
}
body.ambient-zen.ambient-yoru .ambient-zen-brand {
  color: rgba(176, 192, 204, 0.1); /* 夜地の #b0c0cc の極薄透かし（同上） */
}
/* アンビエントモード中の小さなセレクター（右下・z325） */
.ambient-zen-controls {
  position: fixed;
  right: calc(env(safe-area-inset-right) + 20px);
  bottom: calc(env(safe-area-inset-bottom) + 34px);
  z-index: 6;
  width: 38px;
  height: 38px;
  display: none;
}
body.ambient-zen .ambient-zen-controls {
  display: block;
}
.ambient-zen-palette {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.ambient-zen-palette[hidden] {
  display: none;
}
.ambient-zen-controls.open .ambient-zen-palette {
  pointer-events: auto;
}
.ambient-zen-controls::before {
  content: "";
  position: absolute;
  right: -86px;
  bottom: -86px;
  width: 196px;
  height: 196px;
  border-radius: 50%;
  border: 1px solid rgba(98, 123, 136, 0.16);
  opacity: 0;
  transform: scale(0.78);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.42s var(--ease);
}
.ambient-zen-controls.open::before {
  opacity: 1;
  transform: scale(1);
}
.ambient-zen-tone,
.ambient-zen-opt {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid rgba(100, 123, 137, 0.22);
  background: rgba(243, 245, 246, 0.58);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #6c7780;
  box-shadow: 0 10px 24px rgba(55, 73, 82, 0.12);
  align-items: center;
  justify-content: center;
  transition: transform 0.18s var(--ease), background 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.24s ease;
}
.ambient-zen-tone {
  position: relative;
  z-index: 2;
  display: flex;
}
.ambient-zen-controls.open .ambient-zen-tone {
  background: rgba(247, 249, 250, 0.78);
  border-color: rgba(100, 123, 137, 0.36);
}
.ambient-zen-tone:active,
.ambient-zen-opt:active {
  transform: scale(0.9);
}
.ambient-zen-tone svg {
  transition: transform 0.34s var(--ease);
}
.ambient-zen-controls.open .ambient-zen-tone svg {
  transform: rotate(45deg);
}
.ambient-zen-opt {
  position: absolute;
  display: flex;
  opacity: 0;
  transform: translate(10px, 10px) scale(0.72);
}
.ambient-zen-controls.open .ambient-zen-opt {
  opacity: 1;
}
.ambient-zen-opt[aria-pressed="true"] {
  color: #496b7f;
  border-color: rgba(72, 107, 127, 0.54);
  background: rgba(238, 244, 246, 0.84);
  box-shadow: 0 0 0 1px rgba(120, 153, 168, 0.16), 0 12px 28px rgba(55, 73, 82, 0.16);
}
.ambient-zen-opt[data-zen-fx="ame"] {
  right: 0;
  bottom: 56px;
}
.ambient-zen-opt[data-zen-fx="shizuku"] {
  right: 12px;
  bottom: 102px;
}
.ambient-zen-opt[data-zen-fx="nijimi"] {
  right: 40px;
  bottom: 142px;
}
.ambient-zen-opt[data-zen-fx="suminagashi"] {
  right: 78px;
  bottom: 174px;
}
.ambient-zen-opt[data-zen-tone="night"] {
  right: 56px;
  bottom: 0;
}
.ambient-zen-opt[data-zen-tone="mist"] {
  right: 102px;
  bottom: 18px;
}
.ambient-zen-controls.open .ambient-zen-opt[data-zen-fx="ame"] {
  transform: translate(0, 0) scale(1);
  transition-delay: 0.01s;
}
.ambient-zen-controls.open .ambient-zen-opt[data-zen-fx="shizuku"] {
  transform: translate(0, 0) scale(1);
  transition-delay: 0.04s;
}
.ambient-zen-controls.open .ambient-zen-opt[data-zen-fx="nijimi"] {
  transform: translate(0, 0) scale(1);
  transition-delay: 0.07s;
}
.ambient-zen-controls.open .ambient-zen-opt[data-zen-fx="suminagashi"] {
  transform: translate(0, 0) scale(1);
  transition-delay: 0.10s;
}
.ambient-zen-controls.open .ambient-zen-opt[data-zen-tone="night"] {
  transform: translate(0, 0) scale(1);
  transition-delay: 0.03s;
}
.ambient-zen-controls.open .ambient-zen-opt[data-zen-tone="mist"] {
  transform: translate(0, 0) scale(1);
  transition-delay: 0.06s;
}
body.ambient-yoru .ambient-zen-controls::before {
  border-color: rgba(176, 192, 204, 0.12);
}
body.ambient-yoru .ambient-zen-tone,
body.ambient-yoru .ambient-zen-opt {
  border-color: rgba(176, 192, 204, 0.18);
  background: rgba(30, 40, 48, 0.58);
  color: #b0c0cc;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}
body.ambient-yoru .ambient-zen-controls.open .ambient-zen-tone,
body.ambient-yoru .ambient-zen-opt[aria-pressed="true"] {
  border-color: rgba(176, 192, 204, 0.42);
  background: rgba(37, 50, 59, 0.86);
  color: #e1e9ee;
}
@media (max-height: 560px) {
  .ambient-zen-opt[data-zen-fx="suminagashi"] {
    right: 72px;
    bottom: 154px;
  }
  .ambient-zen-opt[data-zen-fx="nijimi"] {
    right: 38px;
    bottom: 126px;
  }
  .ambient-zen-opt[data-zen-fx="shizuku"] {
    right: 12px;
    bottom: 90px;
  }
}
/* app-shell の外にいる固定要素（振り分けバー・トースト）もアンビエントモード中は退く
   ＝「全画面にエフェクトだけ」を保つ（z317レビュー対応） */
body.ambient-zen #sortBar,
body.ambient-zen #toast {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
