/* DOPPEL の HTML 画面（Unity の外）。色は Unity の UiFactory / 人格入力画面にそろえる。 */
:root {
  /* Unity の UiFactory と同じ色：紺のガラス・落ち着いた白の本文・薄い見出し・橙は「次にやること」だけ */
  --bg-top: #241f38;
  --bg-bottom: #0a0c14;
  --surface: rgba(18, 20, 28, 0.78);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.07);
  --text: #f2f2f7;
  --body: #d9dbe5;
  --sub: #a3abbf;
  --dim: #80879a;
  --accent: #ffcc73;
  --action: #ff944d;
  --action-text: #1a1206;
  --error: #ff7366;
  --radius: 20px;
  --radius-small: 12px;
  --column: 680px;
  --gutter: 16px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;

  --tier-acquaintance: #a3abbf;
  --tier-friendly: #ffdb9e;
  --tier-friend: #ffb86b;
  --tier-close-friend: #ff8f5c;
  --tier-awkward: #9ec2ff;
  --tier-dislike: #7599ff;
  --tier-mixed: #cc9eff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-bottom);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Unity のキャンバスは画面いっぱいに置いたまま、HTML の下に隠す（0 サイズにすると Unity が困る） */
#unity-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--bg-bottom);
  outline: none;
  touch-action: none;
}

/* ページ全体をスクロールさせる（スマホでアドレスバーが縮むように）。背景は不透明にして Unity を隠す */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg-bottom) 720px) var(--bg-bottom);
  transition: opacity 0.6s ease;
}
html.in-town, html.in-town body { overflow: hidden; }

.shell.leaving { opacity: 0; pointer-events: none; }
.shell.gone { display: none; }

/* ---- 裏の Unity の読み込み ---- */
.load-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
  background: transparent;
  transition: opacity 0.4s ease;
}
.load-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--action));
  box-shadow: 0 0 8px rgba(255, 170, 90, 0.6);
  transition: width 0.3s ease;
}
.load-bar.done { opacity: 0; }

.view {
  max-width: calc(var(--column) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 28px var(--gutter) 140px;
}

/* ---- 文字 ---- */
.brand { margin: 12px 0 0; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0.32em; }
.headline { margin: 22px 0 14px; font-size: clamp(22px, 5.4vw, 30px); line-height: 1.55; font-weight: 600; letter-spacing: 0.02em; white-space: pre-line; }
.lead { margin: 0 0 18px; color: var(--sub); font-size: 15px; line-height: 1.95; }
.note { margin: 0 0 26px; padding: 2px 0 2px 12px; border-left: 2px solid rgba(255, 204, 115, 0.55); color: var(--sub); font-size: 13px; line-height: 1.7; }
.muted { color: var(--sub); }
.small { font-size: 13px; line-height: 1.6; }

/* ---- カード ---- */
.card {
  margin: 0 0 14px;
  padding: 20px 20px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.card { scroll-margin-top: 16px; }
.card.appear { animation: appear 0.45s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.step { margin: 0; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; }
.card-title { margin: 4px 0 14px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.step-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.step-head .card-title { margin: 0; }
.step-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 204, 115, 0.14); color: var(--accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-icon { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.section-title { margin: 20px 0 8px; color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; }
.section-title:first-child { margin-top: 0; }

textarea, input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(0, 0, 0, 0.25);
  color: var(--body);
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
}
textarea { min-height: 150px; resize: vertical; }
textarea::placeholder, input::placeholder { color: var(--dim); }
/* プロンプトは中身より「送ること」が大事なので、低くして下をぼかす */
textarea.prompt { min-height: 0; height: 128px; color: var(--dim); font-size: 13px; line-height: 1.75; resize: none;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
textarea:focus, input[type="text"]:focus { outline: 2px solid rgba(255, 204, 115, 0.6); outline-offset: 1px; }
input.name { font-size: 20px; font-weight: 700; }

.row { display: flex; gap: 8px; margin-top: 10px; }
.row > .grow { flex: 1; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-small);
  background: #262c3a;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.button:hover { filter: brightness(1.12); }
.button:active { transform: scale(0.98); }
.button.primary { background: var(--action); color: var(--action-text); }
.button.big { min-height: 54px; font-size: 17px; width: 100%; }
.button.soft { background: rgba(255, 255, 255, 0.07); color: var(--body); border: 1px solid var(--line); }
.button.full { width: 100%; margin-top: 10px; }
.button.ghost { background: rgba(255, 255, 255, 0.06); color: var(--sub); font-size: 13px; min-height: 36px; font-weight: 400; }
.button:disabled { opacity: 0.45; cursor: default; filter: none; transform: none; }
.button.waiting { background: #3a3f52; color: var(--text); }

.message { margin: 10px 0 0; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.message.error { color: var(--error); }
.message.info { color: var(--sub); }

/* ---- 人格カード ---- */
.summary {
  margin: 16px 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--body);
  font-size: 16px;
  line-height: 1.85;
}
.traits { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; margin: 0; }
.traits dt { color: var(--sub); font-size: 14px; white-space: nowrap; }
.traits dd { margin: 0; }
.traits .stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
.traits .stars .off { color: #474c5a; }
.meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8f7bd9, var(--accent)); transform-origin: left; animation: grow 0.8s ease both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--body); font-size: 13px; line-height: 1.5; }
.chips.home li { background: rgba(255, 204, 115, 0.12); color: var(--accent); }
.prose { margin: 0; color: var(--body); font-size: 14px; line-height: 1.9; }

/* ---- 再訪 ---- */
.welcome { margin: 18px 0 6px; font-size: clamp(24px, 7vw, 32px); font-weight: 700; }
.since { margin: 0 0 22px; color: var(--sub); font-size: 15px; }

.progress { margin: 8px 0 2px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--action)); transition: width 0.3s ease; }
.skeleton { height: 14px; margin: 12px 0; border-radius: 7px; background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.11), rgba(255,255,255,0.05)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.short { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.log { margin: 0; padding: 0; list-style: none; }
.log li { display: grid; grid-template-columns: 3.4em 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--body); font-size: 15px; line-height: 1.8; }
.log li:first-child { border-top: 0; }
.log time { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.log li.highlight .text { color: var(--text); }
.log li.highlight time { color: var(--accent); }
.day { margin: 16px 0 4px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.day:first-child { margin-top: 0; }
.day .weekday { color: var(--sub); font-weight: 400; margin-left: 6px; }

.quotes { margin: 0; padding: 0; list-style: none; }
.quotes li { margin: 8px 0; padding: 10px 14px; border-radius: var(--radius-small); background: var(--surface-2); font-size: 15px; line-height: 1.7; }
.quotes li::before { content: "“"; color: var(--accent); margin-right: 2px; }
.quotes li::after { content: "”"; color: var(--accent); margin-left: 2px; }

.people { margin: 0; padding: 0; list-style: none; }
.people li { padding: 10px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.people .name { font-size: 16px; font-weight: 600; }
.people .tier { font-size: 13px; font-weight: 600; }
.people .meta { margin-left: auto; color: var(--dim); font-size: 12px; }
.people .memory { margin: 4px 0 0; color: var(--sub); font-size: 14px; line-height: 1.7; }
.people .change { font-size: 14px; color: var(--sub); }
.people .change b { color: var(--text); }

.tier-acquaintance { color: var(--tier-acquaintance); }
.tier-friendly { color: var(--tier-friendly); }
.tier-friend { color: var(--tier-friend); }
.tier-close_friend { color: var(--tier-close-friend); }
.tier-awkward { color: var(--tier-awkward); }
.tier-dislike { color: var(--tier-dislike); }
.tier-like_but_distrust, .tier-trust_but_dislike { color: var(--tier-mixed); }

.thinking { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); background: rgba(143, 123, 217, 0.16); font-size: 15px; line-height: 1.7; }
.thinking small { display: block; color: var(--sub); font-size: 12px; margin-bottom: 2px; }

/* ---- 下の操作欄 ---- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 12, 23, 0) 0%, rgba(10, 12, 23, 0.94) 38%, rgba(10, 12, 23, 0.98) 100%);
}
.dock-inner { max-width: var(--column); margin: 0 auto; }
.dock-status { margin: 0 0 8px; min-height: 1.4em; color: var(--sub); font-size: 13px; text-align: center; }

/* 開発用 */
.dev { margin-top: 18px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- 招待 ---- */
.card.invite { border-color: rgba(255, 204, 115, 0.35); box-shadow: 0 0 0 1px rgba(255, 204, 115, 0.12), 0 10px 30px rgba(0, 0, 0, 0.25); }
.profile .summary { font-size: 16px; }
.profile .chips { margin-top: 8px; }
.options { display: grid; gap: 6px; }
.option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-small); background: var(--surface-2); cursor: pointer; font-size: 15px; }
.option:has(input:checked) { background: rgba(255, 148, 77, 0.16); outline: 1px solid rgba(255, 148, 77, 0.5); }
.option input { accent-color: var(--action); width: 18px; height: 18px; margin: 0; }
.option small { margin-left: auto; font-size: 12px; white-space: nowrap; }
.tier-stranger { color: var(--dim); }

.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: var(--gutter); background: rgba(5, 6, 12, 0.7); }
.modal-card { width: 100%; max-width: 520px; margin: 0; }
.modal-card input[type="text"] { margin: 12px 0 2px; font-size: 13px; color: var(--sub); }

/* ---- ページの下 ---- */
/* 言語切り替え（HTML の画面の右上。街に入ると shell ごと消える） */
.lang-switch { position: fixed; z-index: 20; top: calc(env(safe-area-inset-top, 0px) + 12px); right: var(--gutter); display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); backdrop-filter: blur(8px); }
.lang-switch button { font: inherit; font-size: 12px; min-height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--sub); cursor: pointer; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.1); color: var(--text); cursor: default; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; margin: 28px 0 0; font-size: 12px; }
.links a { white-space: nowrap; }
.links a { color: var(--dim); text-decoration: none; }
.links a:hover { color: var(--sub); text-decoration: underline; }
.ad { margin: 0 0 16px; min-height: 100px; }

/* ---- 恋愛 ---- */
.tier-dating { color: #ff8fb8; }
.tier-ex { color: #b9a3cf; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; font-size: 14px; line-height: 1.6; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--action); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }

/* ---- 会話のセリフ ---- */
.talk-toggle { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.log li.highlight .talk-toggle { font-weight: 700; }
.talk-toggle .chev { display: inline-block; margin-left: 6px; color: var(--accent); font-size: 12px; transition: transform 0.2s ease; }
.talk-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.talk { margin: 8px 0 4px; }
.bubbles { display: grid; gap: 6px; }
.bubble { justify-self: start; max-width: 88%; padding: 7px 12px 8px; border-radius: 4px 14px 14px 14px; background: rgba(255, 255, 255, 0.07); font-weight: 400; font-size: 14px; line-height: 1.6; }
.bubble.mine { justify-self: end; border-radius: 14px 4px 14px 14px; background: rgba(255, 148, 77, 0.18); }
.bubble small { display: block; color: var(--sub); font-size: 11px; }
.feelings { margin: 8px 0 0; color: var(--sub); font-size: 12px; font-weight: 400; }

/* Save failures remain visible above both HTML and the Unity canvas. */
.cloud-status { position: fixed; z-index: 1000; right: 1rem; bottom: 1rem; max-width: min(26rem, calc(100vw - 2rem)); padding: 1rem; }
.cloud-status[hidden] { display: none; }

.modal-card { max-height: calc(100dvh - 2 * var(--gutter)); overflow-y: auto; }

.bgm-toggle { position: fixed; z-index: 30; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); min-height: 44px; padding: 0 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 24px; background: rgba(25,40,30,.75); color: #fff; font: 12px system-ui, sans-serif; cursor: pointer; }
.bgm-toggle[hidden] { display: none; }
.bgm-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.resume-status { position: fixed; z-index: 900; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(18,24,22,.72); color: #fff; font: 16px system-ui, sans-serif; }
.resume-status[hidden] { display: none; }

#friends-modal [hidden] { display: none !important; }
.invite-output { display: grid; gap: 8px; }
.account-modal { z-index: 50; }
.account-field { display: block; margin: 14px 0; }
.account-field input { display: block; width: 100%; margin-top: 6px; padding: 12px; min-height: 46px; font: inherit; color: var(--text); background: #11151b; border: 1px solid var(--line); border-radius: 10px; }
#account-modal [hidden] { display: none !important; }
.modal-card input.invite-code { font-family: monospace; font-size: clamp(15px, 4vw, 22px); color: var(--text); text-align: center; letter-spacing: .04em; }

.invite-switch { display:flex; align-items:center; gap:12px; margin:18px 0 8px; cursor:pointer; }
.invite-switch input { position:absolute; opacity:0; width:44px; height:28px; }
.switch-track { width:44px; height:26px; flex:none; border-radius:20px; background:#4a4d56; padding:3px; transition:background .15s; }
.switch-track::after { content:""; display:block; width:20px; height:20px; border-radius:50%; background:white; transition:transform .15s; }
.invite-switch input:checked + .switch-track { background:#429967; }
.invite-switch input:checked + .switch-track::after { transform:translateX(18px); }
.invite-switch input:focus-visible + .switch-track { outline:2px solid var(--accent); outline-offset:3px; }
.invite-switch input:disabled + .switch-track { opacity:.5; }
.sharing-field { display:grid; grid-template-columns:minmax(0,1fr) 24px 48px; gap:10px; align-items:center; padding:12px 0; border-bottom:1px solid var(--border, #ffffff20); cursor:pointer; }
.sharing-field strong, .sharing-field small { display:block; }
.sharing-field small { color:var(--sub); margin-top:4px; overflow-wrap:anywhere; }
.sharing-field input { width:20px; height:20px; accent-color:var(--accent); }
.sharing-field-state { font-size:12px; text-align:right; }
#friends-modal details { margin:12px 0 20px; }
#friends-modal summary { cursor:pointer; color:var(--sub); font-size:13px; }
#friends-modal input:not([type="checkbox"]) { width:100%; min-height:44px; }
#receive-modal [hidden] { display:none !important; }

.invite-home { width:100%; min-height:44px; border:1px solid var(--line); border-radius:10px; padding:10px; color:var(--text); background:var(--surface-2); font:inherit; }

.sharing-tags { min-width:0; border:0; padding:0; margin:18px 0 8px; display:flex; flex-wrap:wrap; gap:8px; }
.sharing-tags legend { font-weight:700; font-size:14px; color:var(--sub); padding:0; margin-bottom:8px; }
.sharing-texts { flex-direction:column; flex-wrap:nowrap; }
/* 公開＝緑（上の公開スイッチと同じ色）、非公開＝グレーの取り消し線。タップで切り替え */
.sharing-chip { position:relative; display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:6px 12px; border:1px solid; border-radius:999px; font-size:14px; cursor:pointer; user-select:none; transition:background .15s, border-color .15s, color .15s; }
.sharing-chip input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.sharing-chip strong { font-weight:500; }
.sharing-chip .sharing-field-state { font-size:11px; opacity:.75; }
.sharing-chip.is-public:not(.wide) .sharing-field-state { display:none; } /* 公開は色だけで分かるので、文字は非公開のときだけ */
.sharing-chip.is-public { background:rgba(66,153,103,.22); border-color:#429967; color:var(--text); }
.sharing-chip.is-private { background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.14); color:var(--dim); }
.sharing-chip.is-private strong { text-decoration:line-through; text-decoration-color:rgba(255,255,255,.35); }
.sharing-chip:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.sharing-chip.wide { display:flex; align-items:flex-start; border-radius:14px; padding:10px 14px; }
.sharing-chip.wide .chip-text { flex:1; min-width:0; }
.sharing-chip.wide strong, .sharing-chip.wide small { display:block; }
.sharing-chip.wide small { margin-top:3px; color:var(--sub); font-size:12px; line-height:1.5; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sharing-chip.wide.is-private small { opacity:.6; }
.sharing-legend { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin:12px 0 0; font-size:12px; color:var(--sub); }
.sharing-legend .dot::before { content:""; display:inline-block; width:10px; height:10px; margin-right:6px; border-radius:50%; vertical-align:-1px; border:1px solid; }
.sharing-legend .dot.is-public::before { background:rgba(66,153,103,.5); border-color:#429967; }
.sharing-legend .dot.is-private::before { background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.3); }
.profile-choice { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px 0; }
.profile-select { padding:10px; border:1px solid var(--border); border-radius:10px; background:#252936; color:var(--text); font:inherit; max-width:65%; }
.appearance-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:16px 0; }
.appearance-choice { padding:4px; border:2px solid transparent; border-radius:12px; background:#242936; color:var(--text); cursor:pointer; }
.appearance-choice[aria-pressed="true"] { border-color:var(--accent); background:#493e2e; }
.appearance-choice img { display:block; width:100%; aspect-ratio:1; object-fit:contain; }
.appearance-choice:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
.shell-topbar { position:relative; z-index:20; display:flex; justify-content:flex-end; align-items:center; gap:8px; padding:calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) 0; }
.shell-topbar .lang-switch { position:static; }
.shell-topbar .account-entry { min-height:38px; padding:6px 10px; font-size:12px; white-space:nowrap; }
.quick-start .note { margin:12px 0 0; }
.personal-start > summary { cursor:pointer; padding:18px 0; color:var(--accent); font-weight:600; }
#boot-status:empty { display:none; }
#boot-status { margin:12px 0; color:var(--sub); font-size:14px; }

/* STEP 1：普段使っている AI をプロンプト入りで開くボタン */
.ai-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.25rem 0 0.5rem; }
.ai-links .button { width: 100%; padding-left: 0.25rem; padding-right: 0.25rem; white-space: nowrap; }

/* ---- トップの説明（JS なしでも読める本文。操作の画面の下にいつも置く） ---- */
.about { max-width: calc(var(--column) + var(--gutter) * 2); margin: 0 auto; padding: 8px var(--gutter) 160px; border-top: 1px solid var(--line); color: var(--sub); }
.about h2 { margin: 36px 0 12px; color: var(--accent); font-size: 18px; letter-spacing: 0.04em; }
.about h3 { margin: 28px 0 10px; color: var(--text); font-size: 15px; }
.about p, .about li { font-size: 14px; line-height: 1.9; }
.about ul, .about ol { padding-left: 1.3em; margin: 0; }
.about li { margin: 0 0 8px; }
.about strong { color: var(--text); }
.about a { color: var(--accent); }
.about blockquote { margin: 12px 0; padding: 8px 14px; border-left: 2px solid rgba(255, 204, 115, 0.55); color: var(--text); font-size: 14px; line-height: 1.9; }

/* Save diagnostics layout. */
.save-status-stack { position: relative; z-index: 1; width: min(26rem, calc(100vw - 2rem)); margin: 1rem auto; display: grid; gap: .5rem; }
html.in-town .save-status-stack { position: fixed; z-index: 1000; margin: 0; right: 1rem; top: max(1rem, env(safe-area-inset-top)); max-height: min(40dvh, calc(100dvh - 12rem)); overflow-y: auto; }
.save-status-stack[hidden], .save-diagnostic[hidden], .save-diagnostic-modal[hidden] { display: none; }
.save-diagnostic-modal { position: fixed; inset: 0; z-index: 1200; display: grid; justify-items: center; align-content: start; padding: max(1rem, env(safe-area-inset-top)) 1rem; background: rgba(10, 20, 16, .65); }
.save-diagnostic-modal-card { width: min(30rem, 100%); max-height: calc(100dvh - 12rem - env(safe-area-inset-top)); overflow-y: auto; padding: 1rem; box-sizing: border-box; }
.save-diagnostic-modal-card .save-diagnostic { border: 0; padding: 0; margin: .5rem 0 0; }
.save-diagnostic-close { min-height: 44px; }
.save-status-stack .cloud-status { position: static; max-width: none; margin: 0; }
.save-diagnostic { padding: .75rem; font-size: .85rem; }
.save-diagnostic summary { cursor: pointer; min-height: 2rem; }
.save-diagnostic-text { white-space: pre-line; overflow-wrap: anywhere; }
.save-diagnostic button { margin: .25rem 0; }
