:root {
  /* input・textarea・select やスクロールバーなど、CSS では塗れないブラウザ
     ネイティブの部品の既定色をライト前提にする。[data-theme="dark"] 側で
     dark に上書きすると、それらも合わせてダークへ切り替わる。 */
  color-scheme: light;
  --orange: #ff7f27;
  --orange-dark: #f26c1a;
  --orange-soft: #fff1e8;
  --bg: #eceff1;
  --card: #ffffff;
  --ink: #2b2b2b;
  --ink-soft: #7a7f85;
  --line: #e6e8eb;
  --icon-grey: #9aa0a6;
  --ec-bg: #f2f2f0;   /* アイキャッチ画像の余白と同じ色（継ぎ目を消すため） */
  --reply-bg: #ececec;   /* レスの地色：メインスレッド（白）よりややグレー */
  --reply-line: #dcdcdc; /* レス同士の境界線（余白なしで線1本） */
  --gu: #2f80ed;      /* ぐー → 青 */
  --boo: #eb5757;     /* ぶー → 赤 */
  --bookmark: #f2b01e;/* ブクマ → 黄 */
  --danger: #e0533d;
  /* ダークテーマで新たに使うトークン。ライトの既定値は、今まで個別に
     ハードコードされていた近似色（#f6f7f8 / #ececec / #b9bec5 など）に合わせてある
     ので、ライトテーマの見た目はこの導入だけでは変わらない。 */
  --surface-2: #f6f7f8;      /* 入力欄・浮いたカードの既定背景 */
  --surface-press: #ececec;  /* :active の押し込みフィードバック */
  --ink-faint: #b9bec5;      /* 補助・非アクティブ（disabled 等） */
  --overlay: rgba(0, 0, 0, 0.4); /* モーダル・シートの背後スクリム */
  --orange-border: #ffd6bd;  /* var(--orange-soft) と対で使う薄い縁取り */
  --radius: 12px;
  --header-h: 56px;
  /* 「見つける」の棚に並ぶグループカード1枚の高さ。
     カードの中身（画像60＋名前2行＋ゲーム名＋人数＋余白）を足した値。
     0件のときの空き枠もこの高さに合わせるので、必ずここだけを直す。 */
  --discover-card-h: 156px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---------- ダークテーマ ----------
   切り替えは JS（theme-init.js / app.js）が <html data-theme="..."> へ
   'light' か 'dark' を確定させてから行う（ちらつき防止のため、CSS 側は
   通常 prefers-color-scheme を見ない。詳しくは theme-init.js のコメントを参照）。
   HAPi のオレンジ（--orange / --orange-dark）はブランドカラーなので、
   ダークでも変更しない。 */
[data-theme="dark"] {
  color-scheme: dark;
  /* HAPiのオレンジは維持しつつ、彩度・明度を落としてダーク面へ馴染ませる
     （#ff7f27 のような高彩度オレンジは大面積では使わない）。 */
  --orange: #d96b2b;
  --orange-dark: #c45d26;
  --orange-soft: rgba(217, 107, 43, 0.16);
  --orange-border: rgba(217, 107, 43, 0.35);
  /* Discordのダークテーマに合わせ、単純な黒ではなく青み・紫みを
     わずかに含むダークグレーで面の階層を作る（--bg-base が最も暗い層＝
     ヘッダー・下部ナビ周辺、--card/--surface-2 と進むほど少しずつ明るくなる）。 */
  --bg-base: #1e1f22;
  --bg: #232428;
  --card: #2b2d31;
  --surface-2: #313338;
  --surface-press: #3a3c43;
  --ink: #f2f3f5;
  --ink-soft: #b5bac1;
  --ink-faint: #949ba4;
  --line: rgba(255, 255, 255, 0.08);
  --icon-grey: #949ba4;
  --ec-bg: #1e1f22;
  --reply-bg: #26282c;
  --reply-line: rgba(255, 255, 255, 0.08);
  /* ぐー・ぶー・ブクマは、暗い背景でもライトテーマと同じ強さに見えるよう
     わずかに明るくしてある（色相・用途は変えていない）。 */
  --gu: #4e9bff;
  --boo: #ff6b6b;
  --bookmark: #f4c04a;
  --danger: #ff6b52;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --overlay: rgba(0, 0, 0, 0.6);
}
/* 万一 JS が動かない場合（サードパーティ拡張機能等）でも、既定はライトの
   ままにする。theme-init.js / app.js の既定値と揃えるため、OS 側の設定を
   見て自動でダークへ切り替えるフォールバックは持たない
   （data-theme が無いときは :root のライト値がそのまま使われる）。 */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: #d7dbdf;
}

body { display: flex; justify-content: center; }

.phone {
  width: 100%;
  max-width: 460px;
  /* --app-h はソフトウェアキーボードが出たときに JS が実寸へ差し替える。
     100dvh はアドレスバーぶんは考慮するが、キーボードぶんは縮まないため
     入力欄がキーボードの裏に隠れてしまう（2-2）。 */
  height: var(--app-h, 100dvh);
  top: var(--app-top, 0px);
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
}

/* ---------- 縦画面固定（横向きだとレイアウトが崩れるため） ---------- */
/* CSS の @media (orientation: landscape) だけに頼ると、iOS Safari で
   アドレスバーが出入りするアニメーション中に innerWidth/innerHeight が
   一瞬だけ矛盾した値になり、.phone と .rotate-overlay が「両方とも中途半端に
   表示された」状態のまま固まって画面が半分に割れる不具合が起きた
   （メディアクエリの再評価タイミングがブラウザの内部都合に左右されるため）。
   そこで判定はJS側（index.htmlの末尾）でリサイズ後に少し待ってから確定し、
   <html> に is-landscape クラスを付け外しする方式に変えた。CSSはそのクラスを
   見るだけにして、途中経過の値では絶対に切り替わらないようにしてある。 */
.rotate-overlay { display: none; }
html.is-landscape .phone { visibility: hidden; }
html.is-landscape .rotate-overlay {
  display: flex; position: fixed; inset: 0; z-index: 9999;
  width: 100vw; height: 100vh; height: 100dvh;
  flex-direction: column; align-items: center; justify-content: center;
  background: #1c1c1c; color: #fff; text-align: center; padding: 24px;
}
.rotate-icon { font-size: 48px; margin-bottom: 12px; transform: rotate(90deg); }
.rotate-overlay p { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.rotate-overlay p.sub { font-size: 12px; font-weight: 400; opacity: .75; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
/* input・textarea・select は文字色を明示する。ブラウザは要素の文字色を
   継承（inherit）だけでは決めておらず、ページが color-scheme を宣言していないと
   常にライト前提の黒文字で描く（ダーク背景の入力欄で黒地に黒文字になる主要因）。
   color-scheme（:root 側）と合わせて、ここでも var(--ink) を明示しておく。 */
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--ink); }

/* ---------- Screen layout ---------- */
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.screen-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  position: relative; z-index: 1;
  /* 端まで来たときに背面のページごと動く（ゴムのように引っ張られる）のを止める */
  overscroll-behavior: contain;
  /* overflow-y だけ指定すると仕様上 overflow-x は暗黙に auto 扱いになり（visible
     のままにはできないため）、内側の要素が1pxでも幅からはみ出た瞬間に横スワイプ
     可能になって画面端に背面が露出する。.topbar/.bottom-nav には既にある
     touch-action: pan-y が本体のここにだけ抜けていたのが根本原因。
     内側の意図的な横スクロール（.discover-rail 等）は自前の overflow-x: auto を
     持つ別コンテナなので、ここを hidden にしても影響しない。 */
  overflow-x: hidden;
  touch-action: pan-y;
}
.bottom-nav {
  flex: 0 0 auto;
  min-height: 62px;
  padding: 5px 8px max(5px, env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 2px solid #f0a071;
  display: grid;
  /* 閉鎖時は bottom-nav-four-items へ切り替える */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  z-index: 20;
  touch-action: pan-y;
}
.bottom-nav.bottom-nav-four-items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bottom-nav-item {
  min-width: 0; min-height: 50px; padding: 2px 2px 1px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--ink-soft); font-size: 11px; font-weight: 700;
}
.bottom-nav-item.active { color: var(--orange-dark); }
.bottom-nav-item:active { background: var(--orange-soft); border-radius: 10px; }
.bottom-nav-icon { width: 28px; height: 28px; position: relative; display: block; }
.bottom-nav-icon svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.bottom-badge {
  position: absolute; top: -4px; right: -9px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--orange); color: #fff; border: 2px solid #fff;
  font-size: 9px; font-weight: 800; line-height: 14px; text-align: center;
}
.bottom-badge-beta {
  min-width: 14px; height: 14px; padding: 0 3px;
  background: var(--ink-soft); font-size: 8px; line-height: 10px;
}
/* グループの背景画像。カードの後ろに固定で敷く（スクロールしても動かない） */
.group-bg {
  position: absolute; left: 0; right: 0; top: var(--header-h); bottom: 0;
  background-size: cover; background-position: center; z-index: 0; pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  z-index: 5;
  touch-action: pan-y;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h1 { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .sub { font-size: 11px; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* グループ名部分をタップしてグループメニューを開く。薄い枠で操作できる領域を示す。 */
.topbar .title-btn {
  display: block; width: auto; padding: 5px 8px; text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.48); border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}
.topbar .title-btn:hover, .topbar .title-btn:focus-visible { background: rgba(255, 255, 255, 0.16); }
.topbar .title-btn:active { opacity: 0.8; }
.title-caret { font-size: 10px; opacity: 0.85; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; flex-shrink: 0;
}
.iconbtn:active { background: rgba(255, 255, 255, 0.2); }
/* 支援ボタンの画像・共有ボタンのSVGは、ベルと同じ理由で寸法指定を
   .topbar スコープの外へ出す（詳しくは .bell の説明を参照）。
   headerActionsHtml() はPC版のグループヘッダー（.desktop-group-actions）
   でも再利用されるため、.topbar 限定のままだと画像・SVGが寸法指定を
   失う。特に画像（hapi-support.png、実サイズ512x512）は指定が無いと
   自然サイズのまま描画され、40x40の丸ボタンから大きくはみ出して
   ヘッダー全体に覆いかぶさっていた（SVGは正方形viewBoxのぶん被害が
   小さく見えるだけで、同じ原因）。 */
.support-header-btn img { width: 24px; height: 24px; object-fit: contain; display: block; }
/* 共有ボタン（検索・通知ベルと大きさ・余白を揃える） */
.share-btn svg.ico-share { width: 20px; height: 20px; fill: currentColor; display: block; }
.topbar .share-btn.on { background: rgba(255, 255, 255, 0.22); }

/* ---------- 起動画面（ローディング） ----------
   版権のあるアイキャッチ画像は廃止し、アプリ名と読み込み中の表示だけにした。
   画像を待たないので、そのぶん早く次の画面へ進める。 */
.eyecatch {
  flex: 1; background: var(--ec-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; overflow: hidden;
}
.ec-title {
  font-size: 40px; font-weight: 800; letter-spacing: .06em;
  color: var(--orange); animation: pop .5s ease; user-select: none;
}
/* ロード中インジケータ（画像の下） */
.ec-loading {
  display: flex; align-items: center; gap: 10px; margin-top: 30px;
  color: var(--ink-soft); font-size: 13px; font-weight: 600;
}
.ec-loading .spinner {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid rgba(0, 0, 0, 0.12); border-top-color: var(--orange);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Opening / onboarding ---------- */
.opening {
  flex: 1;
  background: linear-gradient(160deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center は使わない。
     中身が画面より高くなったとき（ログイン欄を開いたときなど）、負の余白まで
     等分されて上側がはみ出し、スクロールしても届かなくなる。
     auto マージンなら余白が足りないときに 0 へ落ちるので、上が切れない。 */
  justify-content: flex-start;
  text-align: center;
  padding: 32px;
  position: relative;
  /* はみ出したぶんは縦スクロールで届くようにする（以前は hidden で、
     連携ログインのボタンが画面外に出たまま触れなかった） */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.opening > :first-child { margin-top: auto; }
.opening > :last-child { margin-bottom: auto; }
.opening::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.12), transparent 45%);
  /* ★重要：ここに pointer-events を書き忘れると、この装飾がタップを吸ってしまう。
     .opening は flex なので子要素は z-index が効く（flex アイテムの特例）。
     z-index を持たない .onboard-login だけがこの装飾より下になり、
     「連携ログインのボタンだけ押せない」状態になっていた。 */
  pointer-events: none;
}
.opening .logo {
  width: 96px; height: 96px; border-radius: 24px;
  background: #fff; color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; font-weight: 800;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  margin-bottom: 20px; position: relative; z-index: 1;
  animation: pop .5s ease;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.opening h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: 1px; z-index: 1; }
.opening p { margin: 0 0 36px; opacity: 0.95; font-size: 14px; line-height: 1.6; z-index: 1; }
.opening .cta {
  z-index: 1; background: #fff; color: var(--orange);
  font-weight: 700; font-size: 16px; padding: 14px 20px; border-radius: 999px;
  width: 100%; max-width: 320px; box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.opening .cta:active { transform: translateY(1px); }

/* onboarding form (inside opening / .reg-body) */
.onboard { z-index: 1; width: 100%; max-width: 320px; text-align: left; }
.onboard label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 8px; }
.onboard input {
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  background: rgba(255,255,255,0.95); color: var(--ink); margin-bottom: 18px;
}
.avatar-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.swatch {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid transparent; transition: transform .1s;
}
.swatch.selected { border-color: #fff; transform: scale(1.12); }
.onboard-login {
  /* position + z-index で装飾（.opening::before）より前に出す。
     pointer-events: none との二重の守りにしておく（片方だけ消えても押せる）。 */
  position: relative; z-index: 1;
  width: min(92%, 420px); margin: 20px auto 0; padding: 16px;
  border-radius: 14px; background: rgba(255,255,255,.14); text-align: center;
}
.onboard-login > p { margin: 0 0 9px; font-size: 13px; color: #fff; }
.onboard-login .auth-form {
  margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--card); color: var(--ink); text-align: left;
}
.onboard-login .auth-form input { border: 1px solid var(--line); }

/* ---------- 新規登録画面（添付デザイン再現） ---------- */
/* オレンジのウェーブヘッダー＋白いカード、という見た目のリクエストなので
   .opening とは別の専用クラスで組む。ロゴ（.reg-mark）は添付画像から
   切り出した実画像（public/icons/onboard-mark.png）で、縁をぼかして
   ヘッダーの地色（#fe7602。添付画像から実測した色）へ自然になじませてある。 */
.reg-screen {
  flex: 1; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; background: var(--card);
}
.reg-hero {
  position: relative; overflow: hidden; flex-shrink: 0;
  background: #fe7602;
  padding: 34px 24px 44px; text-align: center; color: #fff;
}
.reg-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.18); pointer-events: none; }
.reg-blob.b1 { width: 90px; height: 90px; left: 6%; top: 46%; }
.reg-blob.b2 { width: 44px; height: 44px; right: 9%; top: 10%; background: rgba(255,255,255,.24); }
.reg-paw-deco { position: absolute; font-size: 38px; opacity: .22; pointer-events: none; }
.reg-paw-deco.right { right: 5%; top: 44%; }
.reg-paw-deco.left { left: 4%; top: 66%; font-size: 24px; }
.reg-mark { width: 62%; max-width: 250px; margin: 0 auto; display: block; position: relative; z-index: 1; }
.reg-hero h1 { margin: 4px 0 6px; font-size: 25px; font-weight: 800; position: relative; z-index: 1; }
.reg-hero p { margin: 0; font-size: 13px; opacity: .95; position: relative; z-index: 1; }
.reg-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 26px; display: block; }
.reg-body { flex: 1; padding: 22px 22px 36px; position: relative; }
.reg-label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; margin: 0 0 10px; color: var(--ink); }
.reg-body .onboard { max-width: none; }
.reg-body .onboard input {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 14px; padding: 15px;
}
.reg-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.reg-avatar-preview {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1.5px dashed var(--line); font-size: 24px;
}
.reg-avatar-preview.has-img { background-color: var(--icon-grey); background-size: cover; background-position: center; border-style: solid; border-color: transparent; }
.reg-avatar-actions { display: flex; gap: 8px; }
.reg-avatar-btn {
  padding: 9px 14px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-dark);
  font-size: 12px; font-weight: 700;
}
.reg-avatar-btn.ghost { background: var(--surface-2); color: var(--ink-soft); }
.reg-avatar-btn:active { opacity: .85; }
.reg-body .avatar-picker { gap: 14px; }
.reg-body .swatch {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.reg-body .swatch.selected { border-color: var(--orange); transform: none; box-shadow: 0 0 0 2px #fff inset; }
.swatch-check { color: #fff; font-size: 18px; font-weight: 800; }
.reg-cta-wrap { position: relative; margin-top: 6px; }
.reg-cta {
  width: 100%; padding: 16px; border-radius: 999px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 20px rgba(255,127,39,.35);
}
.reg-cta:active { transform: translateY(1px); }
.reg-spark { position: absolute; top: -10px; width: 18px; height: 18px; color: var(--orange); pointer-events: none; }
.reg-spark.left { left: 6px; transform: rotate(-12deg); }
.reg-spark.right { right: 6px; transform: rotate(12deg); }
.reg-divider {
  display: flex; align-items: center; gap: 10px; margin: 22px 0 16px;
  color: var(--ink-soft); font-size: 12px;
}
.reg-divider::before, .reg-divider::after { content: ''; flex: 1; border-top: 1px dashed var(--line); }
.reg-login-btn {
  width: 100%; padding: 14px; border-radius: 999px; border: 1.5px solid var(--orange);
  color: var(--orange); background: var(--card); font-weight: 700; font-size: 14px;
}
.reg-login-btn:active { background: var(--orange-soft); }
.reg-body .onboard-login { background: transparent; padding: 0; width: 100%; margin: 0; text-align: center; }
.reg-body .onboard-login > p { color: var(--ink-soft); margin: 0 0 10px; }
.reg-body .onboard-login .auth-form { background: var(--surface-2); border: 1px solid var(--line); }
.reg-paws-footer {
  margin-top: 30px; display: flex; justify-content: center; gap: 46px;
  overflow: hidden; height: 58px;
}
.reg-paw-print { width: 76px; height: 76px; flex-shrink: 0; }
.reg-paw-print.solid { color: var(--orange); transform: rotate(-8deg) translateY(6px); }
.reg-paw-print.outline { color: #e7c8ae; transform: rotate(10deg) translateY(10px); }

/* ---------- 新規登録後の初期セットアップ ---------- */
.ob-screen {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto;
  background: var(--card); color: var(--ink); overscroll-behavior: contain;
}
.ob-main { width: 100%; max-width: 560px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px 18px; }
.ob-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 0 0 34px; }
.ob-progress span { height: 5px; border-radius: 99px; background: var(--line); }
.ob-progress span.active { background: var(--orange); }
.ob-back { min-width: 44px; min-height: 44px; margin: -20px 0 10px -8px; padding: 0 8px; color: var(--ink-soft); font-size: 14px; font-weight: 700; text-align: left; }
.ob-heading h1 { margin: 0 0 10px; font-size: clamp(26px, 7vw, 34px); line-height: 1.25; letter-spacing: -.02em; }
.ob-heading p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }
.ob-content { margin-top: 28px; }
.ob-welcome-mark { width: 112px; height: 112px; margin: 34px auto 26px; border-radius: 34px; display: grid; place-items: center; background: var(--orange-soft); font-size: 50px; transform: rotate(-4deg); }
.ob-lead { text-align: center; color: var(--ink); font-size: 16px; line-height: 1.9; }
.ob-footer {
  position: sticky; bottom: 0; z-index: 4; width: 100%; max-width: 560px; margin: auto auto 0;
  padding: 12px 20px max(16px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.ob-primary { width: 100%; min-height: 52px; border-radius: 16px; background: var(--orange); color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 7px 18px rgba(255,127,39,.25); }
.ob-primary:disabled { opacity: .58; box-shadow: none; }
.ob-skip { display: block; min-height: 44px; margin: -6px auto 4px; padding: 0 18px; color: var(--ink-soft); font-size: 13px; }
.ob-label { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 14px; font-weight: 750; }
.ob-label:not(:first-child) { margin-top: 20px; }
.ob-label span { color: var(--orange-dark); font-size: 11px; }
.ob-input { width: 100%; min-height: 48px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--ink); font: inherit; }
.ob-textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
.ob-color-label { margin: 18px 0 9px; color: var(--ink-soft); font-size: 12px; }
.ob-search { min-height: 50px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.ob-search > span { color: var(--ink-soft); font-size: 24px; }
.ob-search input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.ob-selection-count { min-height: 30px; padding: 9px 2px 0; color: var(--ink-soft); font-size: 12px; }
.ob-section-title { margin: 18px 0 12px; font-size: 15px; }
.ob-game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ob-game-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.ob-game-skeleton span { aspect-ratio: 3 / 4; border-radius: 14px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: ob-shimmer 1.3s infinite; }
@keyframes ob-shimmer { to { background-position: -200% 0; } }
.ob-game-card { min-height: 44px; padding: 0 0 10px; border: 2px solid transparent; border-radius: 14px; overflow: hidden; background: var(--surface-2); color: var(--ink); text-align: left; }
.ob-game-card > span:last-child { display: block; padding: 9px 9px 0; font-size: 13px; font-weight: 700; line-height: 1.35; }
.ob-game-card.selected { border-color: var(--orange); background: var(--orange-soft); }
.ob-game-art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: var(--icon-grey); font-size: 28px; }
.ob-game-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ob-game-art-fallback { display: none; }
.ob-game-art-fallback.visible { display: inline; }
.ob-game-art b { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.25); }
.ob-group-list { display: grid; gap: 12px; }
.ob-group-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.ob-group-card > img, .ob-group-placeholder { width: 52px; height: 52px; border-radius: 13px; object-fit: cover; background: var(--icon-grey); display: grid; place-items: center; }
.ob-group-copy { min-width: 0; }
.ob-group-copy h2 { margin: 0 0 3px; font-size: 14px; line-height: 1.35; }
.ob-group-copy p { margin: 0 0 3px; color: var(--ink-soft); font-size: 11px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ob-group-copy small { color: var(--ink-soft); font-size: 11px; }
.ob-group-card button { min-width: 76px; min-height: 44px; padding: 0 10px; border-radius: 12px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 750; }
.ob-group-card button:disabled { background: var(--line); color: var(--ink-soft); }
.ob-empty { padding: 32px 14px; color: var(--ink-soft); text-align: center; font-size: 13px; line-height: 1.7; }
.ob-empty-groups { margin-top: 42px; padding: 34px 18px; border: 1px dashed var(--line); border-radius: 16px; }

@media (min-width: 560px) {
  .ob-main { padding-inline: 28px; }
  .ob-footer { padding-inline: 28px; }
  .ob-game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ob-game-skeleton { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Group list ---------- */
.tabbar {
  display: flex; background: var(--card); border-bottom: 1px solid var(--line);
}
.tabbar .tab {
  flex: 1; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 3px solid transparent; text-align: center;
}
.tabbar .tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* グループ内は参考画像と同じ2択。追加タブはチャット／ピン留めだけにする。 */
.group-content-tabs {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  position: relative; z-index: 1;
}
.group-content-tabs button {
  min-width: 0; min-height: 38px; padding: 8px 12px; border-radius: 10px;
  color: var(--ink-soft); font-size: 14px; font-weight: 750; text-align: center;
}
.group-content-tabs button.active {
  color: var(--ink); background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .16);
}
.group-content-tabs button:active { background: var(--orange-soft); }

.action-row {
  display: flex; gap: 10px; padding: 12px;
}
.action-row .btn-create {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; color: var(--ink); box-shadow: var(--shadow);
}
.action-row .btn-create .plus { color: var(--orange); font-size: 20px; font-weight: 700; }
.action-row .btn-create:active { background: var(--orange-soft); }

.group-list { padding: 0 12px 24px; }
.group-card {
  background: var(--card); border-radius: 10px; padding: 12px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow);
}
.group-card:active { background: var(--surface-press); }
.group-card .thumb {
  width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 22px;
}
.group-card .meta { flex: 1; min-width: 0; }
.group-card .meta .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-card .meta .desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-card .meta .stats { font-size: 11px; color: var(--ink-soft); margin-top: 6px; display: flex; gap: 12px; }
.group-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bookmark); flex-shrink: 0; }
.group-card > b { font-size: 24px; font-weight: 500; color: var(--ink-faint); flex-shrink: 0; }
.badge-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; }

/* ---------- マイグループ：表示モード切替（1列 / 2列 / アイコンのみ） ---------- */
/* 「n 件のグループ」の行に切替ボタンを1個だけ添える。プルダウンや設定画面は作らない。 */
.group-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 4px; }
.group-list-head .section-label { padding: 0; }
.group-view-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -11px -10px -11px 0; /* 見た目は小さく、タップ領域だけ44px確保 */
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft);
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px; line-height: 1;
}
.group-view-toggle:active { background: var(--surface-press); color: var(--ink); }

/* ---------- 2列表示：デフォルト表示と同じ「アイコン左＋テキスト右」の横並びのまま縮小 ---------- */
.group-list-compact {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 0 12px 24px;
}
.group-card-compact {
  background: var(--card); border-radius: 10px; padding: 10px; box-shadow: var(--shadow);
  min-width: 0; display: flex; align-items: center; gap: 8px;
}
.group-card-compact:active { background: var(--surface-press); }
.gcc-thumb-wrap { position: relative; flex-shrink: 0; }
.group-card-compact .gcc-thumb {
  width: 46px; height: 46px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px;
}
.gcc-dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--bookmark); box-shadow: 0 0 0 2px var(--card); }
.gcc-meta { flex: 1; min-width: 0; }
.gcc-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcc-desc { font-size: 10px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcc-desc .badge-tag { font-size: 9px; padding: 0 4px; }
.gcc-stats { font-size: 9px; color: var(--ink-soft); margin-top: 3px; display: flex; gap: 5px; white-space: nowrap; overflow: hidden; }

/* ---------- アイコンのみ表示：カードを廃止し、アイコンだけを並べる ---------- */
.group-icon-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  padding: 4px 12px 24px;
}
@media (max-width: 340px) {
  .group-icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.group-icon-cell { position: relative; width: 100%; }
.group-icon-cell .gic-thumb {
  width: 100%; aspect-ratio: 1 / 1; height: auto; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 20px;
}
.group-icon-cell:active .gic-thumb { opacity: .8; }
.gic-badge {
  position: absolute; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px var(--card);
}
.gic-verified { right: -3px; bottom: -3px; width: 18px; height: 18px; }
.gic-verified img { width: 14px; height: 14px; object-fit: contain; }
.gic-dev {
  left: -3px; bottom: -3px; width: 16px; height: 16px; background: #2b2b2b; color: #fff;
  font-size: 9px; font-weight: 700;
}
.gic-dot { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--bookmark); box-shadow: 0 0 0 2px var(--card); }

/* ---------- ブックマーク：グループ別2段階表示 ----------
   ①グループ一覧は既存の .group-card をそのまま使う（アイコン・名前・件数・chevron）。
   ②グループ別一覧は、戻るボタン＋そのグループのカード（非活性）を上に置き、
   下は既存の .bm-list / bookmarkItemHtml をそのまま再利用する。 */
.bm-group-detail { padding: 12px 12px 0; }
.bm-back-btn { width: 100%; text-align: center; margin-bottom: 10px; }
.group-card.bm-group-head { margin-bottom: 0; }
.group-card.bm-group-head:active { background: var(--card); }

/* ---------- Thread list (group chat) ---------- */
.thread-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.load-more-btn {
  background: var(--card); color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 13px; font-weight: 700; text-align: center;
}
.load-more-btn:active { background: var(--surface-press); }
/* 表示用トークン方式：.thread-card 側は --tc-* を参照するだけで、
   色テーマは下の .thread-color-* ブロックで --tc-* の値を差し替えるだけ。
   コンポーネント側（本文・時刻・「…」・ジャンルバッジ・リアクション欄）に
   テーマごとの条件分岐を書き足さずに済む。 */
.thread-card {
  --tc-bg: var(--card);
  --tc-fg: var(--ink);
  --tc-muted: var(--ink-soft);
  --tc-icon: var(--icon-grey);
  --tc-border: transparent;
  --tc-line: var(--line);
  --tc-badge-bg: var(--surface-2);
  --tc-badge-fg: var(--ink-soft);
  --tc-press: var(--surface-press);
  background: var(--tc-bg); color: var(--tc-fg); border: 1px solid var(--tc-border);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.thread-card .thread-head .who .time { color: var(--tc-muted); }
.thread-card .thread-head .more { color: var(--tc-icon); }
.thread-card .genre-badge { background: var(--tc-badge-bg); color: var(--tc-badge-fg); }
.thread-card .reaction-bar { border-top-color: var(--tc-line); }
.thread-card .reaction-bar .rbtn { color: var(--tc-icon); }
.thread-card .reaction-bar .rbtn .count { color: var(--tc-muted); }
/* タップ時の押し込みフィードバックも、鮮やかな背景の上では不透明グレーではなく
   半透明の白フラッシュにして、グラデーションを潰さないようにする。 */
.thread-card .thread-body[data-act]:active { background: var(--tc-press); }
/* ヘッダー：[アイコン] [名前・時刻] [詳細 ⋯] */
.thread-head { display: flex; gap: 8px; padding: 10px 12px 0; align-items: flex-start; }

/* ---------- レス（thread detail の返信一覧） ----------
   メインスレッド＝白いカード。レス＝ややグレーで、端まで広がる連続リスト。
   レスとレスの間に余白は作らず、境界は 1px の線だけで表す。 */
.reply-list { background: var(--reply-bg); }
.reply-item { background: var(--reply-bg); border-top: 1px solid var(--reply-line); }
.reply-item:first-child { border-top: none; }
/* ヘッダー：アイコン左 / 名前・時刻 左寄せ / 詳細 ⋯ 右 */
.reply-head { display: flex; gap: 10px; padding: 10px 12px 0; align-items: flex-start; }
.reply-head .who { flex: 1; min-width: 0; }
.reply-head .who .name { font-weight: 700; font-size: 14px; word-break: break-word; }
.reply-head .who .time { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.reply-item .reply-body { font-size: 14px; }
/* 区切りは上の border-top 1本だけにしたいので、バー上の線は消す */
.reply-item .reaction-bar { border-top: none; margin-top: 4px; }
.reply-item .reaction-bar .rbtn:active { background: rgba(0, 0, 0, 0.05); }
.avatar {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px;
}
.supporter-paw{position:absolute;right:-4px;bottom:-4px;width:20px;height:20px;z-index:2;filter:drop-shadow(0 1px 2px #0004);pointer-events:none}
.supporter-paw img{display:block;width:100%;height:100%;object-fit:contain}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
/* アイコン → ネーム の順で左寄せ（実機と同じ並び） */
.thread-head .who { flex: 1; min-width: 0; text-align: left; }
.thread-head .who .name { font-weight: 700; font-size: 14px; word-break: break-word; }
.thread-head .who .time { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.shout-flag { font-size: 10px; color: #fff; background: var(--danger); padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.edited-flag { font-size: 10px; color: var(--ink-soft); font-weight: 400; margin-left: 4px; }
/* 【固定】バッジ：カード最上部の帯。既存の【ピン留め】(📌)と混同しないよう
   絵文字は使わず、色も別にする（ピン留めには元々カード上のバッジが無い）。 */
.thread-fixed-flag {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--gu);
  padding: 3px 12px; letter-spacing: .04em;
}
.thread-body { padding: 8px 12px 4px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.mention { color: var(--gu); }

/* ---------- スレッドのジャンル・色（親スレッドだけ。レスには付けない） ---------- */
.genre-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); white-space: nowrap;
}
/* 親スレッドカードだけに乗せる鮮やかなグラデーション背景。レス（.reply-item /
   .reply-row）にはこのクラスを一切付けないので、レスの地色（グレー）は常に
   維持される。淡いパステルではなく彩度・存在感のある配色にして、アプリの
   ライト/ダークテーマに関係なく同じ見た目にする（テーマ切り替えの上書きは
   不要）。文字・アイコン・バッジは全テーマとも白系（--tc-fg 等）にして、
   濃い/鮮やかな背景の上でも読める最低限のコントラストを確保している。 */
.thread-card.thread-color-red {
  --tc-bg: linear-gradient(135deg, #ff4d4d 0%, #ff7a3d 100%);
  --tc-fg: #fff; --tc-muted: rgba(255, 255, 255, .75); --tc-icon: rgba(255, 255, 255, .85);
  --tc-border: rgba(255, 255, 255, .22); --tc-line: rgba(255, 255, 255, .28);
  --tc-badge-bg: rgba(255, 255, 255, .22); --tc-badge-fg: #fff; --tc-press: rgba(255, 255, 255, .16);
}
.thread-card.thread-color-green {
  --tc-bg: linear-gradient(135deg, #00c853 0%, #00bfa5 100%);
  --tc-fg: #fff; --tc-muted: rgba(255, 255, 255, .75); --tc-icon: rgba(255, 255, 255, .85);
  --tc-border: rgba(255, 255, 255, .22); --tc-line: rgba(255, 255, 255, .28);
  --tc-badge-bg: rgba(255, 255, 255, .22); --tc-badge-fg: #fff; --tc-press: rgba(255, 255, 255, .16);
}
.thread-card.thread-color-blue {
  --tc-bg: linear-gradient(135deg, #2979ff 0%, #00b0ff 100%);
  --tc-fg: #fff; --tc-muted: rgba(255, 255, 255, .75); --tc-icon: rgba(255, 255, 255, .85);
  --tc-border: rgba(255, 255, 255, .22); --tc-line: rgba(255, 255, 255, .28);
  --tc-badge-bg: rgba(255, 255, 255, .22); --tc-badge-fg: #fff; --tc-press: rgba(255, 255, 255, .16);
}
.thread-card.thread-color-purple {
  --tc-bg: linear-gradient(135deg, #7c4dff 0%, #e040fb 100%);
  --tc-fg: #fff; --tc-muted: rgba(255, 255, 255, .75); --tc-icon: rgba(255, 255, 255, .85);
  --tc-border: rgba(255, 255, 255, .22); --tc-line: rgba(255, 255, 255, .28);
  --tc-badge-bg: rgba(255, 255, 255, .22); --tc-badge-fg: #fff; --tc-press: rgba(255, 255, 255, .16);
}
.thread-card.thread-color-black {
  --tc-bg: linear-gradient(135deg, #111111 0%, #2b2b2b 100%);
  --tc-fg: #fff; --tc-muted: rgba(255, 255, 255, .7); --tc-icon: rgba(255, 255, 255, .8);
  --tc-border: rgba(255, 255, 255, .14); --tc-line: rgba(255, 255, 255, .16);
  --tc-badge-bg: rgba(255, 255, 255, .14); --tc-badge-fg: #fff; --tc-press: rgba(255, 255, 255, .1);
}
/* 検索結果の行（.bm-item）はカードではないので、左端の帯だけで色を示す（軽い表現）。 */
.bm-item.thread-color-red     { border-left: 3px solid #ff5c3d; }
.bm-item.thread-color-green   { border-left: 3px solid #00c853; }
.bm-item.thread-color-blue    { border-left: 3px solid #2979ff; }
.bm-item.thread-color-purple  { border-left: 3px solid #9c4dff; }
.bm-item.thread-color-black   { border-left: 3px solid #2b2b2b; }

.reaction-bar {
  display: flex; align-items: center; border-top: 1px solid var(--line); margin-top: 8px;
}
.reaction-bar .rbtn {
  flex: 1; padding: 9px 4px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--icon-grey); font-weight: 600;
}
.reaction-bar .rbtn:active { background: var(--surface-press); }
.reaction-bar .rbtn svg.ico { width: 20px; height: 20px; fill: currentColor; display: block; }
/* Recolor only when the current viewer has reacted (server sets .on via mine[]). */
.reaction-bar .rbtn.on.gu { color: var(--gu); }
.reaction-bar .rbtn.on.boo { color: var(--boo); }
.reaction-bar .rbtn.on.bookmark { color: var(--bookmark); }
/* 件数 0 のときはラベル文字（ぶー / 返信 …）が入る */
.reaction-bar .rbtn .count { min-width: 6px; color: var(--ink-soft); white-space: nowrap; }
.reaction-bar .rbtn.on .count { color: currentColor; }

/* role labels (leader / sub-leader) — cosmetic only */
.role-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; vertical-align: middle; }
.role-badge.leader { background: var(--orange-soft); color: var(--orange-dark); border: 1px solid var(--orange-border); }
.role-badge.sub { background: #eaf2fe; color: #2f6fd0; border: 1px solid #cfe0fb; }

/* bookmark tab list */
.bm-list { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.bm-item .bm-ctx { font-size: 11px; color: var(--ink-soft); margin: 0 2px 6px; display: flex; align-items: center; gap: 6px; }
.bm-item .bm-kind { background: var(--bookmark); color: #fff; font-weight: 700; padding: 1px 7px; border-radius: 4px; }
.bm-item .thread-card { box-shadow: var(--shadow); }

/* members / sub-leader modal */
.member-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; max-height: 50vh; overflow-y: auto; }
.member-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.member-row .mname { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-row-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; justify-content: flex-end; }
.sub-toggle { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface-2); }
.sub-toggle.active { background: #eaf2fe; color: #2f6fd0; border-color: #cfe0fb; }

/* サブリーダー権限設定モーダル */
.sub-perm-header { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.sub-perm-header .mname { font-size: 15px; font-weight: 700; }

/* 一覧のレスプレビューも同じくグレー地・余白なし・境界は線1本
   グレー欄全体がスレッドを開くボタンなので、押した行だけ沈ませる */
.replies-preview { border-top: 1px solid var(--reply-line); background: var(--reply-bg); cursor: pointer; }
.see-all { text-align: center; padding: 12px; color: var(--orange-dark); font-size: 13px; font-weight: 700; }
.see-all:active { background: var(--surface-press); }
.reply-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--reply-line); }
.reply-row:active { background: var(--surface-press); }
.reply-row:first-child { border-top: none; }
.reply-row .who { flex: 1; min-width: 0; }
/* 名前は投稿者の色、時刻は右端（3枚目の画像と同じ） */
.reply-row .who .name { font-size: 12px; font-weight: 700; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.reply-row .who .name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.reply-row .who .name .time { font-weight: 400; margin-left: auto; flex-shrink: 0; }
.reply-row .who .text { font-size: 14px; line-height: 1.5; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

/* ---------- Composer ---------- */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px;
  background: var(--card); border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px;
  padding: 9px 14px; max-height: 120px; line-height: 1.4; background: var(--surface-2);
  box-sizing: border-box; overflow-y: auto;
}
.composer textarea:focus { outline: none; border-color: var(--orange); background: var(--surface-2); }
/* 送信ボタンは画像添付ボタン（.plus-btn）と同じく、textareaの高さに追従させず
   常に一定サイズで下端に固定する。以前は align-self: stretch で textarea と
   同じ高さまで伸びており、複数行入力でtextareaが伸びる／内部スクロールバーが
   出るとボタンが不自然に巨大化し、見た目・当たり判定がスクロールUIと
   干渉していた（PC版で顕著）。stretchをやめてもレイアウトはflexのままなので、
   textarea側は従来どおり自由に高さが変わる。 */
.composer .send {
  background: var(--orange); color: #fff; font-weight: 700; border-radius: 18px;
  padding: 9px 16px; min-width: 60px; align-self: flex-end; flex: none;
}
.composer .send:disabled { background: var(--surface-press); color: var(--ink-faint); }

/* ---------- Modal (create group) ---------- */
.modal-scrim {
  position: absolute; inset: 0; background: var(--overlay);
  display: flex; align-items: flex-end; z-index: 60;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); width: 100%; border-radius: 16px 16px 0 0; padding: 18px 18px 24px;
  max-height: 90%; overflow-y: auto; animation: slideup .2s ease;
}
@keyframes slideup { from { transform: translateY(30px); } to { transform: translateY(0); } }
.modal h2 { margin: 4px 0 16px; font-size: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.toggle-row { display: flex; gap: 10px; }
.toggle-row .opt {
  flex: 1; padding: 12px; text-align: center; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.toggle-row .opt.active { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions button { flex: 1; padding: 14px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.modal-actions .cancel { background: var(--surface-2); color: var(--ink); }
.modal-actions .primary { background: var(--orange); color: #fff; }
.modal-actions .primary:disabled { background: var(--surface-press); color: var(--ink-faint); }

/* ---------- 外部リンクの確認ダイアログ ---------- */
.ext-link-modal .ext-link-body { font-size: 13px; line-height: 1.7; color: var(--ink); margin: 0 0 14px; }
.ext-link-modal .ext-link-danger {
  background: #fdeeee; border: 1px solid #f6c6c6; color: var(--danger);
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.6; margin-bottom: 14px; font-weight: 600;
}
.ext-link-domain {
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; word-break: break-all;
}
.ext-link-domain b { color: var(--ink); }
.ext-link-check {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft);
  margin-bottom: 6px; cursor: pointer;
}
.ext-link-check input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--orange); }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--ink-soft); padding: 48px 24px; font-size: 14px; line-height: 1.7; }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.toast {
  position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(0,0,0,0.82); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 40; animation: fade .15s ease; max-width: 90%; text-align: center;
}
.ob-screen + .toast { bottom: max(104px, calc(88px + env(safe-area-inset-bottom))); }
.section-label { padding: 14px 12px 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* ============================================================================
   以下、あとから足した機能ぶんのスタイル
   （アイコン画像 / 通知 / 開発者モード / 画像投稿 / マイページ / グループ設定）
   ============================================================================ */

/* ---------- アイコン画像 ----------
   background-image は要素が置かれた直後には何も描けず、画像が届くまで
   透明な穴になる（背景色が無いため）。ダウンロードが終わるまでの間、
   目立たない中間グレーで場所だけ占めておく（簡素なプレースホルダー）。
   届いたら background-image がそのまま上に重なって置き換わるので、
   追加のJS処理は要らない。 */
.avatar.has-img { background-color: var(--icon-grey); background-size: cover; background-position: center; color: transparent; }
.avatar.me { cursor: pointer; }
.avatar.me:active { opacity: .75; }
.group-card .thumb.has-img { background-color: var(--icon-grey); background-size: cover; background-position: center; }
.group-card-compact .thumb.has-img,
.group-icon-cell .thumb.has-img { background-color: var(--icon-grey); background-size: cover; background-position: center; }
.badge-dev {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: #2b2b2b; color: #fff; vertical-align: middle;
}
/* 「常に上に表示」にしたグループの目印 */
.badge-pin { font-size: 12px; vertical-align: middle; }

/* ---------- Hapi公認ゲームグループの認証マーク ---------- */
/* 青い猫の顔のシルエット＋白いチェックマーク。通常ユーザーは使えない特別なバッジ。 */
.hapi-verified-badge {
  width: 18px; height: 18px; vertical-align: -3px; margin-right: 3px;
  display: inline-block; object-fit: contain;
}
.hapi-verified-badge-btn {
  display: inline; padding: 0; border: 0; background: transparent; cursor: pointer;
  line-height: 1; vertical-align: baseline;
}
.hapi-verified-badge-btn.static { cursor: inherit; }

/* ---------- ゲーム選択（IGDB候補） ---------- */
.game-picker {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative;
}
.game-picker.picked {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.game-picker.verified-info { background: var(--orange-soft); border-color: var(--orange-border); }
.game-pick-cover {
  width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--icon-grey); flex-shrink: 0;
}
.game-pick-cover.placeholder { background: var(--icon-grey); }
.game-pick-name { font-weight: 700; font-size: 14px; flex: 1; }
.game-suggestions {
  position: relative; width: 100%; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.game-suggestions:empty { border: none; }
.game-suggestions:not(:empty) { margin-bottom: 10px; }
#group-filter-suggestions:not(:empty) { margin-top: -4px; }
.game-suggest-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.game-suggest-item:last-child { border-bottom: none; }
.game-suggest-item:active { background: var(--surface-press); }
.game-suggest-item:disabled { cursor: not-allowed; opacity: .62; }
.game-suggest-item img, .game-suggest-noart {
  width: 28px; height: 28px; border-radius: 5px; object-fit: cover; background: var(--icon-grey); flex-shrink: 0;
}
.game-suggest-name { font-size: 13px; }
.game-suggest-name .yr { color: var(--ink-soft); font-size: 11px; }
.game-suggest-note { padding: 10px; font-size: 12px; color: var(--ink-soft); }
.game-suggest-heading { padding: 8px 10px 6px; color: var(--ink-soft); font-size: 12px; font-weight: 700; background: var(--surface-2); }

/* ---------- @メンションの候補（フォロー中のユーザーだけ・項目9-1） ---------- */
.mention-suggestions {
  position: absolute; left: 8px; right: 8px; bottom: 100%; margin-bottom: 6px;
  max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); box-shadow: 0 -4px 16px rgba(0, 0, 0, .3); z-index: 5;
}
.mention-suggestions:empty { display: none; }
.mention-suggest-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.mention-suggest-item:last-child { border-bottom: none; }
.mention-suggest-item:active { background: var(--surface-press); }
.mention-suggest-name { font-size: 13px; }

/* ---------- 投稿ヘッダーの 詳細（…）ボタン ---------- */
.thread-head .more, .reply-head .more {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  color: var(--icon-grey); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.thread-head .more:active, .reply-head .more:active { background: var(--surface-press); }

/* ---------- 通知（ベル + 右から開くドロワー） ---------- */
/* ベルとバッジは1つの部品として扱う。position: relative を .topbar 配下だけに
   付けていたため、同じ bellHtml() を使うPC版ヘッダー（.desktop-global-header）では
   バッジの基準親が無くなり、.phone（PCでは画面全幅）まで遡って画面右上に貼り付いて
   いた。アイコンの寸法指定も同様にPCへ届いておらず、SVGがviewBoxしか持たないため
   モバイル22pxに対しPCだけ28pxになっていた。どちらも親に依存しない形へ移す。 */
.bell { position: relative; flex-shrink: 0; }
.bell svg.ico-bell { width: 22px; height: 22px; fill: currentColor; display: block; }
.bell.on { background: rgba(255, 255, 255, 0.22); }
.bell-dot {
  position: absolute; top: 4px; right: 4px; min-width: 15px; height: 15px; border-radius: 999px;
  background: #e01e1e; color: #fff; font-size: 10px; font-weight: 800; line-height: 15px;
  text-align: center; border: 1.5px solid var(--orange);
}
/* ---------- グループ画面：招待パネル（項目3） ----------
   モーダル（画面中央）ではなく、topbar の直下から下方向へプルダウンする。
   閉じ方はパネル外タップ／✕／共有ボタンの再タップの3通り。 */
.invite-scrim {
  position: absolute; left: 0; right: 0; top: var(--header-h); bottom: 0;
  background: var(--overlay); z-index: 21; animation: fade .15s ease;
}
.invite-panel {
  position: absolute; left: 0; right: 0; top: var(--header-h); z-index: 22;
  background: var(--card); border-radius: 0 0 18px 18px;
  padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: invite-drop .2s ease;
}
@keyframes invite-drop { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.invite-panel-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  color: var(--ink-soft); font-size: 15px;
}
.invite-panel-close:active { background: var(--surface-press); }
.invite-panel-title { margin: 4px 28px 8px 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.invite-panel-desc { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.invite-url-box {
  background: var(--orange-soft); color: var(--orange-dark); border: 1px solid var(--orange-border);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 600;
  word-break: break-all; margin-bottom: 14px;
}
.invite-panel-btn {
  display: block; width: 100%; padding: 13px; border-radius: 999px;
  font-weight: 700; font-size: 14px; margin-bottom: 8px; background: var(--surface-2); color: var(--ink);
}
.invite-panel-btn.primary { background: var(--orange); color: #fff; }
.invite-panel-btn:active { opacity: 0.85; }
.notif-scrim { position: absolute; inset: 0; background: var(--overlay); z-index: 24; animation: fade .15s ease; }
/* 右半分を基本の幅にする。小さい端末では狭くなりすぎないよう下限を置き、
   画面より広がらないよう上限も置く（横にはみ出さない）。 */
.notif-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 50%; min-width: min(300px, 88%); max-width: 100%;
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); z-index: 25; display: flex; flex-direction: column;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.22); animation: slidein .18s ease;
}
/* ドロワーを開いている間は、後ろの一覧が一緒に動かないようにする */
.phone.drawer-open .screen-body { overflow: hidden; }
.notif-drawer-foot {
  flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--card);
}
.notif-drawer-foot button {
  width: 100%; padding: 14px; font-size: 13px; font-weight: 700; color: var(--orange-dark);
}
.notif-drawer-foot button:active { background: var(--orange-soft); }
@keyframes slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }
.notif-head {
  height: var(--header-h); min-height: var(--header-h); background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 14px;
  font-weight: 700; font-size: 15px;
}
.notif-head .notif-x { color: #fff; font-size: 16px; width: 34px; height: 34px; border-radius: 50%; }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item { display: flex; gap: 9px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.notif-item:active { background: var(--surface-press); }
.notif-item.unread { background: var(--orange-soft); }
.notif-meta { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: baseline; gap: 6px; }
.notif-top .nm { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-top .tm { font-size: 10px; color: var(--ink-soft); margin-left: auto; flex-shrink: 0; }
.notif-body {
  font-size: 13px; line-height: 1.45; margin-top: 2px; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-ctx { font-size: 10px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-empty { padding: 40px 18px; text-align: center; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.notification-page-list {
  background: var(--card); min-height: 100%;
}
.notification-page-list .notif-item { padding: 14px; cursor: pointer; }

/* ---------- ぐー・ぶーした人の一覧 ---------- */
.reactor-list { background: var(--card); min-height: 100%; }
.reactor-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px;
  border: none; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.reactor-row:active { background: var(--surface-press); }
.reactor-info { min-width: 0; }
.reactor-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.reactor-verb { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 2px; color: var(--ink-soft); }
.reactor-verb .ico { width: 14px; height: 14px; fill: currentColor; }
.reactor-verb.gu { color: var(--gu); }
.reactor-verb.boo { color: var(--boo); }

/* ---------- 開発者モードのボタン ---------- */
.dev-chip {
  flex-shrink: 0; font-size: 10px; font-weight: 700; color: #fff; padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; white-space: nowrap;
}
.dev-chip.on { background: #fff; color: var(--orange-dark); border-color: #fff; }
.dev-chip:active { background: rgba(255, 255, 255, 0.25); }
.topbar .avatar.topbar-me { border: 2px solid rgba(255, 255, 255, 0.85); }

/* ---------- 投稿画像 ---------- */
/* 画像の読み込みが終わるまで高さが 0 のままだと、画面を作り直したときに下の内容が
   一度せり上がってから押し下げられ、スクロール位置がずれて画面が揺れる。
   min-height で先に場所を確保しておく（表示上限は下の max-height で決まるので、
   サムネイルの実ピクセルサイズ＝長辺640pxを上げても、ここは変えなくてよい）。 */
.post-img-wrap { padding: 6px 12px 4px; display: flex; justify-content: center; }
.post-img {
  width: 100%; height: 100%; min-height: 0; max-width: none; max-height: none;
  display: block; object-fit: cover; object-position: center; background: var(--surface-2);
}
.post-img-grid {
  width: min(100%, 430px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px; margin-inline: auto;
}
.post-img-grid.count-1 { grid-template-columns: minmax(0, 1fr); }
.post-img-grid.count-3 .post-img-cell:last-child {
  width: calc((100% - 6px) / 2); grid-column: 1 / -1; justify-self: center;
}
.post-img-cell {
  position: relative;
  min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2); cursor: pointer;
}
.post-img-wrap.sm { padding: 6px 0 0; justify-content: flex-start; }
.post-img-wrap.sm .post-img-grid { width: min(100%, 250px); gap: 4px; margin-inline: 0; }
.post-img-wrap.sm .post-img-grid.count-3 .post-img-cell:last-child { width: calc((100% - 4px) / 2); }

/* ---------- 画像スポイラー（ネタバレ防止） ---------- */
/* 投稿者が画像単位で指定できる。タップして表示するまでは強くぼかし、
   中央に「ネタバレ／タップして表示」を重ねる。解除は閲覧中のタブ限りの
   ローカルUI状態で、再訪時やページ再読み込みでは元の隠れた状態に戻る。 */
.post-img.spoiler-blur { filter: blur(16px) brightness(.72); transform: scale(1.15); }
.spoiler-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: #fff; text-align: center; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
.spoiler-label { font-size: 13px; font-weight: 700; }
.spoiler-hint { font-size: 10px; opacity: .9; }
.post-img-wrap.sm .spoiler-label { font-size: 11px; }
.post-img-wrap.sm .spoiler-hint { font-size: 9px; }

/* ---------- 投稿スタンプ（先行実装・開発者限定） ---------- */
/* LINEのような小さな絵文字ではなく、スタンプ自体が主役に見える大きさで中央表示する。
   不要な背景カードは付けず、画像そのものだけを置く（透明PNG/WebP/SVG想定）。 */
.post-stamp-wrap { padding: 4px 12px 6px; display: flex; justify-content: center; }
.post-stamp { width: 160px; max-width: min(60%, 220px); height: auto; object-fit: contain; display: block; }
@media (min-width: 720px) {
  .post-stamp { width: 180px; }
}
/* レス一覧のプレビュー・ブックマークの小カードなど、コンパクトに出す場面（項目6）。 */
.post-stamp-wrap.sm { padding: 6px 0 0; justify-content: flex-start; }
.post-stamp-wrap.sm .post-stamp { width: 64px; max-width: 64px; }

.zoom-scrim {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.9); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 12px; animation: fade .15s ease;
  touch-action: none; overflow: hidden;
}
.zoom-scrim img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: none; }
.zoom-spoiler {
  position: relative; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.zoom-spoiler img.spoiler-blur { filter: blur(32px) brightness(.6); transform: scale(1.2); }
.zoom-spoiler .spoiler-label { font-size: 20px; }
.zoom-spoiler .spoiler-hint { font-size: 14px; }
/* 2枚投稿されている場合の、拡大表示での前後移動（右スワイプ／右矢印＝次へ）。 */
.zoom-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.zoom-nav:active { background: rgba(255, 255, 255, .28); }
.zoom-nav.prev { left: 6px; }
.zoom-nav.next { right: 6px; }
.zoom-dots {
  position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 6px; z-index: 2; pointer-events: none;
}
.zoom-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .4); }
.zoom-dots span.on { background: #fff; }

/* ---------- 画像トリミング（アイコン・背景） ---------- */
.crop-scrim {
  position: absolute; inset: 0; background: #000; z-index: 70;
  display: flex; flex-direction: column; animation: fade .15s ease;
}
.crop-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
}
.crop-head button { padding: 8px 4px; font-size: 15px; font-weight: 700; background: none; color: #fff; }
.crop-head .crop-ok { color: var(--orange); }
.crop-title { font-size: 13px; color: rgba(255, 255, 255, .8); }
.crop-stage {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 0;
}
.crop-img {
  position: absolute; top: 50%; left: 50%; max-width: none; max-height: none;
  will-change: transform; user-select: none; -webkit-user-drag: none;
}
.crop-guide {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border: 2px solid #fff; box-shadow: 0 0 0 2000px rgba(0, 0, 0, .55); pointer-events: none;
}
.crop-guide.circle { width: min(72vw, 300px); height: min(72vw, 300px); border-radius: 50%; }
.crop-guide.rect { width: min(88vw, 380px); border-radius: 6px; }
.crop-controls {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 20px 4px; color: #fff;
}
.crop-controls .crop-zoom { flex: 1; }
.crop-zoom-ico { font-size: 16px; opacity: .8; }
.crop-hint { flex: none; text-align: center; font-size: 11px; color: rgba(255, 255, 255, .6); padding: 4px 0 max(14px, env(safe-area-inset-bottom)); }

/* ---------- コンポーザー（＋ボタン / 添付プレビュー） ---------- */
.composer-wrap { background: var(--card); border-top: 1px solid var(--line); position: relative; z-index: 2; }
.composer-wrap .composer { border-top: none; }
.composer.locked {
  background: var(--card); border-top: 1px solid var(--line); padding: 14px 16px; position: relative; z-index: 2;
  font-size: 12px; color: var(--ink-soft); text-align: center; line-height: 1.6;
}
/* 未参加のときに入力欄の代わりに出す「グループに参加する」 */
.composer.join {
  display: block; background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 16px 14px; position: relative; z-index: 2; text-align: center;
}
.composer.join .join-btn {
  width: 100%; background: var(--orange); color: #fff; font-weight: 700;
  border-radius: 22px; padding: 12px 16px; font-size: 15px;
}
.composer.join .join-btn:active { background: var(--orange-dark); }
.composer.join .join-note { font-size: 11px; color: var(--ink-soft); margin-top: 8px; line-height: 1.6; }
.composer .plus-btn {
  width: 34px; height: 34px; min-width: 34px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 20px; line-height: 1; align-self: center;
  display: flex; align-items: center; justify-content: center;
}
.composer .plus-btn:active { background: var(--orange-soft); color: var(--orange-dark); border-color: var(--orange); }
.composer .plus-btn[disabled] { opacity: .4; }
.composer .plus-btn svg.ico { width: 18px; height: 18px; }
/* 投稿前に選んでいるジャンル・色を確認・解除できる小さなチップ */
.composer-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.composer-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  color: var(--orange-dark); background: var(--orange-soft); border: 1px solid var(--orange-border);
  padding: 4px 6px 4px 10px; border-radius: 999px;
}
.composer-chip .chip-x {
  width: 16px; height: 16px; border-radius: 50%; background: var(--card); color: var(--orange-dark);
  font-size: 9px; display: flex; align-items: center; justify-content: center; line-height: 1;
}
/* スレッド色を選ぶシートの1行（丸いカラープレビュー＋名前） */
.color-sheet-btn { display: flex; align-items: center; gap: 12px; }
.color-sheet-label { display: flex; flex-direction: column; }
.color-swatch {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%; border: 1px solid var(--line);
}
/* 丸の中は実際にカードへ適用される背景（グラデーション）をそのまま映す。 */
.color-swatch.swatch-default { background: var(--surface-2); }
.color-swatch.swatch-red     { background: linear-gradient(135deg, #ff4d4d 0%, #ff7a3d 100%); border-color: transparent; }
.color-swatch.swatch-green   { background: linear-gradient(135deg, #00c853 0%, #00bfa5 100%); border-color: transparent; }
.color-swatch.swatch-blue    { background: linear-gradient(135deg, #2979ff 0%, #00b0ff 100%); border-color: transparent; }
.color-swatch.swatch-purple  { background: linear-gradient(135deg, #7c4dff 0%, #e040fb 100%); border-color: transparent; }
.color-swatch.swatch-black   { background: linear-gradient(135deg, #111111 0%, #2b2b2b 100%); border-color: transparent; }
/* 添付待ちの画像（最大4枚）。それぞれ右上の✕で個別に外せる。 */
.img-pending-list { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px 0; flex-wrap: wrap; }
.img-pending { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.img-pending img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.img-pending .img-x {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--ink-soft); font-size: 11px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.img-pending-list .img-note { flex-basis: 100%; font-size: 11px; color: var(--ink-soft); }
/* 画像単位のスポイラー指定（項目2）。チェック済みだとオレンジで強調する。 */
.img-spoiler-toggle {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; line-height: 1;
  color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 7px 3px 5px; background: var(--card); white-space: nowrap;
}
.img-spoiler-toggle.on { color: var(--orange-dark); border-color: var(--orange); background: var(--orange-soft); }
.img-spoiler-box {
  width: 12px; height: 12px; border-radius: 3px; border: 1px solid currentColor;
  display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; line-height: 1;
}

/* ---------- スタンプ（先行実装・開発者限定） ---------- */
/* 入力欄の右端の丸ボタン。選択中は少しオレンジで目立たせる。 */
.composer .stamp-btn.on { background: var(--orange-soft); color: var(--orange-dark); border-color: var(--orange); }
/* 選択中のスタンプのプレビュー（送信前にここで解除できる）。画像添付と同じ見た目に揃える。 */
.stamp-pending { position: relative; display: inline-flex; padding: 8px 10px 0; }
.stamp-pending img { width: 64px; height: 64px; object-fit: contain; display: block; }
.stamp-pending .img-x {
  position: absolute; top: 1px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--ink-soft); font-size: 11px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* 画面下部から展開するスタンプ選択パネル（.modal-scrim を流用）。 */
.stamp-picker-modal { max-height: 72vh; display: flex; flex-direction: column; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.stamp-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stamp-picker-head h2 { margin: 0; font-size: 16px; }
.stamp-picker-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch;
}
.stamp-picker-item {
  aspect-ratio: 1 / 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; padding: 8px;
}
.stamp-picker-item:active { background: var(--orange-soft); border-color: var(--orange); }
.stamp-picker-item img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- シート（… メニュー / グループメニュー） ---------- */
.sheet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.sheet-name { font-size: 12px; color: var(--ink-soft); padding: 0 2px 2px; }
.sheet-btn {
  width: 100%; text-align: left; padding: 14px; border-radius: 10px; background: var(--surface-2);
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.sheet-btn:active { background: var(--surface-press); }
.sheet-btn.danger { color: var(--danger); }
.sheet-note { font-size: 12px; color: var(--ink-soft); line-height: 1.7; padding: 4px 2px; }

/* ---------- マイページ ---------- */
/* 設定項目が増えたので、意味のまとまりごとにカードへ分けている。
   上から プロフィール → アカウント → 通知 → その他 → 別アカウントへのログイン。
   いちばん下の「別のアカウントにログイン」は、間違って押すと今の端末のデータから
   離れてしまうため、他と切り離して置き、色も文言も分けている。 */
.mypage { padding: 16px 14px 40px; display: flex; flex-direction: column; gap: 14px; }
.mp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 16px 18px;
}
.mp-card-title {
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: .04em; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
/* 未登録のときのアカウント欄は、気づいてもらいたいので目立たせる */
.mp-card.accent { border-color: var(--orange-border); background: var(--orange-soft); }
.mp-card.accent .mp-card-title { color: var(--orange-dark); }
.mp-card.quiet { background: transparent; border-style: dashed; }
.mp-card .cta-solid { margin-top: 12px; }
.mp-card > .push-setting { margin-top: 0; padding-top: 0; border-top: 0; }
.acct-badge {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--orange);
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0;
}
.acct-rows { display: flex; flex-direction: column; gap: 10px; }
.acct-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface-2); border-radius: 10px;
}
.acct-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); flex-shrink: 0; }
.acct-value {
  font-size: 13px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-ok { color: #2e9e5b; font-weight: 700; flex-shrink: 0; }
.acct-note { font-size: 12px; line-height: 1.75; color: var(--ink-soft); margin: 12px 0 0; }
.mp-card.accent .acct-note { color: #8a5a33; }
.acct-note.warn { color: var(--ink-soft); }
.acct-note.warn b { color: var(--danger); }
.mp-btn.sm { padding: 6px 12px; font-size: 12px; flex-shrink: 0; }
/* 各社ブランドの登録・ログインボタン。それぞれの提供元が示す配色に合わせている。 */
.mp-btn.oauth-google, .mp-btn.oauth-apple, .mp-btn.oauth-discord { margin-top: 10px; }
.mp-btn.oauth-google::before, .mp-btn.oauth-apple::before, .mp-btn.oauth-discord::before {
  content: ''; display: inline-block; width: 15px; height: 15px; margin-right: 8px;
  vertical-align: -3px; background: no-repeat center/contain;
}
/* Google：白地＋枠線 */
.mp-btn.oauth-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; }
.mp-btn.oauth-google::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234285F4' d='M45.1 24.5c0-1.6-.1-3.1-.4-4.5H24v8.5h11.8c-.5 2.7-2 5-4.4 6.6v5.5h7.1c4.700-4.3 6.6-10.6 6.6-16.1z'/%3E%3Cpath fill='%2334A853' d='M24 46c6 0 11-2 14.6-5.4l-7.1-5.5c-2 1.3-4.5 2.1-7.5 2.1-5.8 0-10.7-3.9-12.4-9.1H4.3v5.7C7.9 41.1 15.4 46 24 46z'/%3E%3Cpath fill='%23FBBC05' d='M11.6 28.1c-.4-1.3-.7-2.7-.7-4.1s.2-2.8.7-4.1v-5.7H4.3C2.8 17.1 2 20.4 2 24s.8 6.9 2.3 9.8l7.3-5.7z'/%3E%3Cpath fill='%23EA4335' d='M24 10.8c3.3 0 6.2 1.1 8.5 3.3l6.3-6.3C35 4.3 30 2 24 2 15.4 2 7.9 6.9 4.3 14.2l7.3 5.7c1.7-5.2 6.6-9.1 12.4-9.1z'/%3E%3C/svg%3E");
}
.mp-btn.oauth-google:active { background: var(--surface-press); }
/* Apple：黒地＋白ロゴ（Apple のヒューマンインターフェースガイドラインに沿った配色） */
.mp-btn.oauth-apple { background: #000; color: #fff; }
.mp-btn.oauth-apple::before {
  width: 13px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='%23fff' d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141 4 184.8 4 273.5c0 26.2 4.8 53.3 14.4 81.2 12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E");
}
.mp-btn.oauth-apple:active { background: #1a1a1a; }
/* Discord：ブランドカラーの blurple */
.mp-btn.oauth-discord { background: #5865f2; color: #fff; }
.mp-btn.oauth-discord::before {
  width: 17px; height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='%23fff' d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.85-72.15zM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.05 12.69-11.43 12.69z'/%3E%3C/svg%3E");
}
.mp-btn.oauth-discord:active { background: #4752c4; }
/* 登録・ログインの入力フォーム */
.auth-form {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.mp-card.accent .auth-form { border-top-color: var(--orange-border); }
.auth-step {
  font-size: 12px; font-weight: 700; color: var(--orange-dark); margin-bottom: 12px;
}
.auth-form .field { margin-bottom: 12px; }
.auth-msg {
  font-size: 12px; line-height: 1.7; color: var(--danger);
  background: #fdeeeb; border-radius: 8px; padding: 10px 12px; margin-bottom: 4px;
}
.linklike {
  display: block; width: 100%; margin-top: 12px; padding: 6px;
  font-size: 12px; color: var(--ink-soft); text-decoration: underline; background: none;
}
.mp-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.mp-face {
  width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 34px;
}
.mp-face.has-img { background-color: var(--icon-grey); background-size: cover; background-position: center; }
.mp-btns { display: flex; flex-direction: column; gap: 8px; }
.mp-btns.row { flex-direction: row; }
.mp-btn {
  padding: 9px 14px; border-radius: 999px; background: var(--orange); color: #fff;
  font-size: 13px; font-weight: 700;
}
.mp-btn.ghost { background: var(--surface-2); color: var(--ink-soft); }
.mp-btn:active { opacity: .85; }
.mypage .field input, .mypage .field textarea { background: var(--surface-2); }
.mypage .avatar-picker { margin-bottom: 4px; }
.cta-solid {
  width: 100%; background: var(--orange); color: #fff; font-weight: 700; font-size: 16px;
  padding: 14px; border-radius: 12px; margin-top: 8px;
}
.cta-solid:active { transform: translateY(1px); }
.mp-dev {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 12px;
}

/* ---------- その他 / ユーザー検索 / お問い合わせ ---------- */
.more-page { display: flex; flex-direction: column; background: var(--bg); }
.more-profile {
  width: 100%; min-height: 122px; padding: 20px 18px;
  display: flex; align-items: center; gap: 15px;
  color: #fff; background: #727578; text-align: left;
}
/* 背景バナーを設定しているときは、それをこの帯にも敷く（style 属性で url を渡す） */
.more-profile.has-banner { background-size: cover; background-position: center; }
.more-face {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; font-weight: 700;
  border: 3px solid rgba(255,255,255,.85);
}
.more-face.has-img { background-color: rgba(255,255,255,.25); background-size: cover; background-position: center; }
.more-profile > span:nth-of-type(1) {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 20px; font-weight: 700;
}
.more-chevron { color: rgba(255,255,255,.75); font-size: 30px; }
.more-menu { margin-top: 12px; background: var(--card); border-top: 1px solid var(--line); }
.more-row {
  width: 100%; min-height: 64px; padding: 0 18px;
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--card); border-bottom: 1px solid var(--line); font-size: 16px;
}
.more-row:active { background: var(--surface-press); }
.more-row-icon { width: 24px; height: 24px; color: var(--ink-soft); flex-shrink: 0; }
.more-row-icon svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.more-row > span:nth-child(2) { flex: 1; }
.more-row b, .user-search-row b { font-size: 26px; color: var(--ink-faint); font-weight: 500; }
.more-row.support-row .more-row-icon { color: var(--orange-dark); }
.more-spacer { flex: 1; min-height: 40px; }
.account-nudge {
  margin: 18px 14px 22px; padding: 16px;
  border: 1px solid var(--orange-border); border-radius: 14px; background: var(--orange-soft);
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px;
}
.account-nudge-icon { font-size: 25px; }
.account-nudge h2 { margin: 1px 0 5px; font-size: 15px; color: var(--orange-dark); }
.account-nudge p { margin: 0; font-size: 12px; line-height: 1.65; color: #8a5a33; }
.account-nudge .cta-solid { grid-column: 1 / -1; margin-top: 4px; }
.account-saved {
  margin: 18px 14px 24px; padding: 12px 14px; border-radius: 10px;
  background: #eaf7ef; color: #2e8b57; font-size: 12px; font-weight: 700; text-align: center;
}
.ib-icon.support-heart {
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: #fff0e6; color: var(--orange-dark);
  font-size: 25px; font-weight: 700;
}
.ib-cta.support { min-width: 72px; }
.support-screen{background:var(--bg)}
.support-page{position:relative;padding:50px 18px max(32px,env(safe-area-inset-bottom));background:linear-gradient(180deg,var(--orange-soft) 0,var(--bg) 290px);overflow-x:hidden}
.support-close{position:absolute;top:max(12px,env(safe-area-inset-top));right:16px;z-index:2;width:40px;height:40px;border-radius:50%;background:var(--card);color:var(--ink);font-size:28px;line-height:1;box-shadow:var(--shadow)}
.support-hero{max-width:640px;margin:0 auto 24px;text-align:center}
.support-logo{display:block;width:78px;height:78px;margin:0 auto 16px;border-radius:22px;box-shadow:0 8px 22px rgba(244,123,32,.22)}
.support-hero h1{margin:0;color:var(--ink);font-size:29px;letter-spacing:.02em}
.support-hero p{margin:9px 0 0;color:var(--ink-soft);font-size:14px;line-height:1.7}
.support-content{max-width:640px;margin:0 auto}
.support-about-card{padding:21px 19px;border:1px solid var(--orange-border);border-radius:22px;background:var(--card);box-shadow:var(--shadow)}
.support-about-card p{margin:0 0 12px;color:var(--ink-soft);font-size:14px;line-height:1.85}.support-about-card p:last-child{margin-bottom:0}
.support-thanks{padding:28px 2px 22px}.support-thanks h2{margin:0 0 18px;color:var(--ink);font-size:19px}
.support-benefits{display:grid;gap:18px}.support-benefit{display:grid;grid-template-columns:54px 1fr;gap:14px;align-items:center}
.support-benefit>img{width:54px;height:54px;object-fit:contain;filter:drop-shadow(0 2px 4px #0002)}
.support-benefit h3{margin:0 0 4px;color:var(--ink);font-size:15px}.support-benefit p{margin:0;color:var(--ink-soft);font-size:13px;line-height:1.65}
.support-color-icon{width:50px;height:50px;border-radius:15px;display:flex;align-items:flex-end;justify-content:center;gap:3px;padding:10px;background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow)}
.support-color-icon i{width:9px;border-radius:6px}.support-color-icon i:nth-child(1){height:19px;background:#f47b20}.support-color-icon i:nth-child(2){height:29px;background:#62aa66}.support-color-icon i:nth-child(3){height:24px;background:#7b68c9}
.support-plan-card{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:2px 0 18px;padding:18px;border:2px solid var(--orange);border-radius:20px;background:var(--card);box-shadow:0 6px 20px rgba(244,123,32,.12)}
.support-plan-card div{display:grid;gap:4px}.support-plan-card span{color:var(--ink-soft);font-size:12px}.support-plan-card strong{color:var(--ink);font-size:17px}.support-plan-card>b{color:var(--orange-dark);font-size:19px;white-space:nowrap}
.support-content>.support-note{margin:0 0 14px;padding:12px;border-radius:12px;background:var(--surface-2);color:var(--ink-soft);font-size:12px;text-align:center}
.support-mark,.support-result-icon{width:58px;height:58px;margin:0 auto 14px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--orange-soft);color:var(--orange-dark);font-size:30px}
.support-disclosure {
  margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); text-align: left;
}
.support-disclosure p { margin: 0 0 7px; font-size: 12px; line-height: 1.6; }
.support-disclosure p:last-child { margin-bottom: 0; }
.support-disclosure strong { color: var(--ink); }
.support-checkout-btn {
  width: 100%; min-height: 50px; padding: 12px 18px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--orange); color: #fff; font-size: 16px; font-weight: 700;
}
.support-checkout-btn:disabled { opacity: .65; }
.support-spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
.support-error {
  margin: 12px 0; padding: 11px 12px; border-radius: 9px;
  background: #fff0f0; color: #b42318; font-size: 13px; line-height: 1.55; text-align: left;
}
.support-result { max-width: 640px; margin: 0 auto 16px; padding: 18px 16px; border-radius: 14px; text-align: center; }
.support-result.success { background: #eaf7ef; color: #236b45; }
.support-result.cancel { background: #fff7e8; color: #7a5520; }
.support-result h2 { margin: 4px 0 8px; font-size: 20px; }
.support-result p { margin: 0; font-size: 13px; line-height: 1.65; }
.support-result .support-result-icon { margin-bottom: 8px; background: #fff; color: #2e8b57; }
.support-legal-links{margin-top:18px}
@media (min-width:700px){.support-page{padding-top:64px}.support-hero h1{font-size:34px}.support-about-card{padding:25px 28px}.support-content{max-width:600px}}

/* ---------- 支援ページ：運営費メーター ---------- */
.support-meter { margin: 18px 0; text-align: left; }
.support-meter-loading { font-size: 13px; color: var(--ink-soft); text-align: center; padding: 8px 0; }
.support-meter-head { font-size: 13px; font-weight: 700; color: var(--ink); }
.support-meter-amount { margin-top: 4px; font-size: 20px; font-weight: 800; color: var(--ink); }
.support-meter-bar-wrap { position: relative; margin-top: 26px; }
.support-meter-badge {
  position: absolute; top: -26px; transform: translateX(-50%);
  padding: 3px 9px; border-radius: 999px; background: var(--card);
  border: 1.5px solid var(--orange); color: var(--orange-dark);
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.support-meter-bar {
  height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden;
}
.support-meter-fill {
  height: 100%; border-radius: 999px; transition: width .4s ease, background-color .4s ease;
}
.support-meter-scale {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 11px; color: var(--ink-soft);
}
.support-meter-note {
  margin: 10px 0 0; padding: 9px 10px; border-radius: 9px;
  background: var(--surface-2); color: var(--ink-soft); font-size: 11px; line-height: 1.6; text-align: left;
}
.support-meter-form {
  margin: 14px 0 0; padding: 12px; border-radius: 10px; text-align: left;
  background: var(--card); border: 1px dashed var(--ink-faint); box-shadow: var(--shadow);
}
.support-meter-form-head {
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--ink);
}
.support-meter-form-head .dev-only {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: #2b2b2b; color: #fff;
}
.support-meter-form-row { display: flex; gap: 10px; margin-top: 10px; }
.support-meter-form-row label {
  flex: 1; min-width: 0; display: block; font-size: 11px; color: var(--ink-soft);
}
.support-meter-form-row input {
  width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; background: var(--surface-2); font-size: 14px; color: var(--ink);
}
.support-meter-form-row input:focus { outline: none; border-color: var(--orange); background: var(--surface-2); }
.support-meter-form-error {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: #fff0f0; color: #b42318; font-size: 12px; line-height: 1.5;
}
.support-meter-save-btn {
  width: 100%; margin-top: 10px; padding: 11px; border-radius: 10px;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 13px;
}
.support-meter-save-btn:disabled { opacity: .65; }

/* ---- アクセス分析（開発者専用） ---- */
.analytics-page { padding: 4px 0 24px; }
.analytics-note {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--ink-soft); font-size: 12px; line-height: 1.6;
}
.analytics-section-title {
  margin: 22px 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.analytics-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.analytics-card {
  background: var(--card); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow);
}
.analytics-card-label { font-size: 12px; color: var(--ink-soft); }
.analytics-card-value { margin-top: 4px; font-size: 22px; font-weight: 800; color: var(--ink); }
.analytics-card-sub { margin-top: 4px; font-size: 12px; }
.analytics-change { color: var(--ink-soft); }
.analytics-change.up { color: var(--gu); }
.analytics-change.down { color: var(--danger); }
.analytics-change.muted { color: var(--ink-faint); }
.analytics-period-tabs { margin-top: 4px; }
.analytics-chart-card {
  margin-top: 12px; background: var(--card); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow);
}
.analytics-chart-head { font-size: 13px; font-weight: 700; color: var(--ink); }
.analytics-chart-svg { display: block; width: 100%; height: 96px; margin-top: 8px; }
.analytics-chart-baseline { stroke: var(--line); stroke-width: 1; }
.analytics-chart-empty { padding: 24px 0; text-align: center; color: var(--ink-soft); font-size: 13px; }
.analytics-chart-range { margin-top: 6px; font-size: 11px; color: var(--ink-faint); text-align: right; }
.analytics-legend { display: flex; gap: 14px; margin-top: 6px; }
.analytics-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-soft); }
.analytics-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (min-width: 900px) {
  .analytics-grid { grid-template-columns: repeat(3, 1fr); }
}

.user-search-form {
  padding: 10px 12px; display: flex; gap: 8px; background: var(--card); border-bottom: 1px solid var(--line);
}
.user-search-form input {
  flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.user-search-form button {
  padding: 0 17px; border-radius: 10px; background: var(--orange); color: #fff; font-weight: 700;
}
.user-search-results { background: var(--card); min-height: 100%; }
.user-search-row {
  width: 100%; min-height: 64px; padding: 10px 15px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.user-search-row > span { flex: 1; font-size: 15px; }
.block-list-note {
  padding: 13px 16px; background: #fff7f1; border-bottom: 1px solid #ffd9bf;
  color: #865537; font-size: 11px; line-height: 1.65;
}
.block-list { background: var(--card); min-height: 100%; }
.block-list-row {
  min-height: 68px; padding: 9px 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.block-list-user {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  text-align: left; background: transparent;
}
.block-list-user-info {
  min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.block-list-user-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 15px;
}
.block-list-unblock {
  flex-shrink: 0; padding: 8px 13px; border: 1px solid #e3a680; border-radius: 9px;
  color: var(--orange-dark); background: var(--card); font-size: 12px; font-weight: 700;
}
.block-list-unblock:active { background: var(--orange-soft); }
.block-list-empty { padding-top: 70px; }
/* フォロー・フォロワー一覧のオンライン表示（項目9-2） */
.follow-online {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #2e9e5b;
}
.follow-online.offline { color: var(--ink-soft); }
.online-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #2e9e5b; flex-shrink: 0;
}
/* プロフィール画面の「フォロー N ・ フォロワー N」（項目3-2・3-5） */
.follow-stats {
  display: flex; gap: 18px; margin: 2px 0 12px;
}
.follow-stat {
  background: transparent; font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: baseline; gap: 4px;
}
.follow-stat b { font-size: 15px; color: var(--ink); font-weight: 700; }
button.follow-stat:active { opacity: .6; }
/* フォロー・フォロワー一覧の @ハンドル表示（項目3-3・3-4） */
.block-list-user-handle {
  font-size: 12px; color: var(--ink-soft);
}
.contact-page { padding: 20px 16px 40px; }
.contact-page > p { margin: 0 0 20px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.contact-page input, .contact-page textarea {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.contact-page textarea { resize: vertical; line-height: 1.6; }
.contact-destination { margin-top: 12px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.settings-page { padding: 14px 14px 40px; }

/* ---------- 設定：カテゴリ一覧（アコーディオン） ----------
   カテゴリだけを並べた1枚のカードの中に、タップした行だけがその場で展開される。
   開閉は 'toggle-settings-section'（app.js）が対象の .settings-item に .open を
   付け外しするだけの軽い DOM 操作で行うので、ここでは主にその開閉に対する
   見た目の変化を書く。高さのアニメーションは max-height を 0 ↔ 十分大きな値で
   動かす方式にしている（grid-template-rows の 0fr↔1fr は理屈のうえでは綺麗だが、
   中身が文章のときに「1行ぶん」だけ畳みきれない場合があるため避けた）。 */
.settings-list {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
}
.settings-item { border-bottom: 1px solid var(--line); }
.settings-item:last-child { border-bottom: 0; }
.settings-row {
  width: 100%; min-height: 64px; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--card);
}
.settings-row:active { background: var(--surface-press); }
.settings-row-icon { width: 22px; height: 22px; color: var(--ink-soft); flex-shrink: 0; }
.settings-row-icon svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.settings-item.open .settings-row-icon { color: var(--orange-dark); }
.settings-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-row-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.settings-row-sub { font-size: 12px; color: var(--ink-soft); }
.settings-row-chevron {
  flex-shrink: 0; font-size: 20px; font-weight: 500; color: var(--ink-faint);
  transition: transform 200ms ease, color 200ms ease;
}
.settings-item.open .settings-row-chevron { color: var(--orange-dark); transform: rotate(90deg); }
.settings-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 220ms ease;
}
/* 開いたときの上限は、いちばん中身が長くなるカテゴリ（未登録時のアカウント欄・
   ログインフォームを開いたアカウント管理欄など）でも切れないだけの余裕を持たせる。 */
.settings-item.open .settings-panel { max-height: 900px; }
.settings-panel-inner { padding: 0 16px 18px; }
.settings-subhead {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: .04em; margin: 2px 0 10px;
}
/* 「退会する」など、通常操作と混ざってほしくない危険な操作の区切り */
.settings-danger-block {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.settings-danger-block .mp-btn { margin: 0; }

/* ---------- 設定：外観（ライト / ダーク / 端末設定に合わせる） ---------- */
.theme-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-seg-btn {
  flex: 1 1 auto; min-width: 88px; padding: 10px 8px; text-align: center;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft); background: var(--surface-2);
}
.theme-seg-btn.active { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }
.theme-seg-btn:active { opacity: .85; }

/* ---------- グループ設定 ---------- */
.gs-row { display: flex; align-items: center; gap: 14px; }
.gs-icon {
  width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; background: var(--icon-grey);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: #fff;
}
.gs-icon.has-img { background-color: var(--icon-grey); background-size: cover; background-position: center; color: transparent; }
.gs-bg {
  height: 92px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-soft);
}
.gs-bg.has-img { background-size: cover; background-position: center; border-style: solid; }
.gs-tag-row { display: flex; gap: 8px; }
.gs-tag-row input { flex: 1; }
.gs-tag-row .mp-btn { flex-shrink: 0; }
/* グループ削除（取り返しがつかない操作なので枠で区切って目立たせる） */
.danger-zone { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-btn {
  width: 100%; padding: 13px; border-radius: 10px; font-weight: 700; font-size: 14px;
  color: var(--danger); background: #fdf0ee; border: 1px solid #f5cdc5;
}
.danger-btn:active { background: #fadfda; }
.danger-zone .hint { font-size: 11px; color: var(--ink-soft); margin-top: 8px; line-height: 1.6; }
.modal-actions .primary.danger { background: var(--danger); }
.modal-actions .primary.danger:disabled { background: #cfd3d6; }

/* ---------- 端末通知の設定（マイページ） ---------- */
.push-setting { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.push-setting .ps-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.push-setting .ps-note { font-size: 11px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 10px; }
.push-setting .ps-state { font-size: 12px; font-weight: 700; }
.push-setting .ps-state.on { color: #2f9e44; }
.push-setting .ps-state.off { color: var(--ink-soft); }
/* ブラウザのタブから開いているときの注意書き（ホーム画面アプリを勧める） */
.push-setting .ps-warn {
  background: var(--orange-soft); border: 1px solid var(--orange-border); border-radius: 8px;
  padding: 9px 11px; margin-bottom: 10px;
  font-size: 11px; line-height: 1.7; color: var(--orange-dark);
}

/* ---------- ホーム画面に追加（インストール誘導） ---------- */
.install-banner {
  margin: 12px 12px 0; padding: 10px 12px; border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--orange-border);
  display: flex; align-items: center; gap: 10px;
}
.install-banner .ib-icon { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.install-banner .ib-text { flex: 1; min-width: 0; }
.install-banner .ib-title { font-size: 13px; font-weight: 700; }
.install-banner .ib-sub { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.install-banner .ib-cta {
  flex-shrink: 0; background: var(--orange); color: #fff; font-weight: 700; font-size: 12px;
  padding: 8px 14px; border-radius: 999px;
}
.install-banner .ib-cta:active { background: var(--orange-dark); }
.install-banner .ib-x {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  color: var(--icon-grey); font-size: 12px;
}
.ios-share {
  display: inline-block; padding: 0 6px; border-radius: 5px;
  background: #eaf2fe; color: #2f6fd0; font-weight: 700;
}

/* ---------- 通知タブ上部の「通知オンにする」推奨バナー ---------- */
/* 設定画面のどこにあるか分かりにくいという指摘への対応。通知タブを開いた人のうち、
   まだオンにしていない人にだけ、ここで直接オンにできる導線を出す。 */
.notif-push-banner {
  margin: 12px 12px 0; padding: 12px 14px; border-radius: 10px;
  background: var(--orange-soft); border: 1px solid var(--orange-border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.notif-push-banner .npb-text { flex: 1; min-width: 160px; font-size: 12px; line-height: 1.6; color: var(--orange-dark); }
.notif-push-banner .npb-btn {
  flex-shrink: 0; background: var(--orange); color: #fff; font-weight: 700; font-size: 12px;
  padding: 9px 16px; border-radius: 999px;
}
.notif-push-banner .npb-btn:active { background: var(--orange-dark); }

/* ---------- 検索 / 絞り込み ---------- */
.search-btn.on { background: rgba(255, 255, 255, 0.25); border-radius: 8px; }
/* 支援ボタン・共有ボタンと同じ理由（.bell の説明を参照）で、寸法指定を
   .topbar スコープの外へ出す。PC版のグループヘッダーでも同じボタンを使う。 */
.search-btn svg.ico-search { width: 22px; height: 22px; fill: currentColor; display: block; }
.group-scroll-top {
  position: absolute; right: 14px; bottom: 82px; z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: #fff; border: 2px solid #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .24); font-size: 24px; font-weight: 800;
}
.group-scroll-top:active { background: var(--orange-dark); transform: scale(.96); }
.search-bar, .filter-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 2;
}
.filter-row { border-bottom: none; padding-bottom: 4px; background: transparent; }
.filter-input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 18px;
  padding: 9px 14px; background: var(--surface-2); font-size: 14px;
}
.filter-input:focus { outline: none; border-color: var(--orange); background: var(--surface-2); }
.filter-x {
  width: 32px; height: 32px; border-radius: 50%; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.filter-x:active { background: var(--surface-press); }
.search-row { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); }
.search-meta { flex: 1; min-width: 0; }
.search-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.search-top .nm { font-weight: 700; }
.search-top .tm { color: var(--ink-soft); margin-left: auto; flex-shrink: 0; }
.search-body { font-size: 14px; line-height: 1.5; margin-top: 3px; word-break: break-word; }
.search-body mark { background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; border-radius: 3px; }

/* ---------- 他ユーザーのプロフィール ---------- */
.up-name { font-size: 20px; font-weight: 700; }
.mp-btn.wide { width: 100%; text-align: center; margin-bottom: 10px; }
.up-note { font-size: 11px; color: var(--ink-soft); line-height: 1.7; margin-top: 6px; }
.up-blocked {
  background: #fdecea; color: var(--danger); font-size: 12px; line-height: 1.7;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; text-align: center;
}
.follow-state {
  background: #eef8f1; color: #2e8b57; font-size: 13px; font-weight: 700;
  padding: 11px 14px; border-radius: 10px; margin-bottom: 10px; text-align: center;
}

/* ---------- 通報 ---------- */
.report-reasons { display: flex; flex-direction: column; gap: 6px; }
.report-reasons .opt {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; color: var(--ink-soft); text-align: left;
}
.report-reasons .opt.active { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; }
.report-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.report-card { background: var(--card); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.report-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.report-top .tm { font-size: 11px; color: var(--ink-soft); margin-left: auto; }
.report-line { font-size: 14px; }
.report-line.sub { font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.report-reason { font-size: 13px; color: var(--danger); font-weight: 700; margin-top: 4px; }
.report-snap {
  font-size: 12px; color: var(--ink-soft); background: var(--surface-2); border-radius: 8px;
  padding: 8px 10px; margin-top: 8px; line-height: 1.6; word-break: break-word;
}
.report-actions { display: flex; gap: 8px; margin-top: 10px; }
.report-actions .mp-btn { flex: 1; text-align: center; }
.report-actions .mp-btn[disabled] { opacity: .45; }

/* ---------- 公認グループの変更申請（アイコン・背景のプレビュー） ---------- */
.ger-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.ger-thumb {
  width: 64px; height: 64px; flex: none; border-radius: 8px; background: var(--surface-2);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1.4; color: var(--ink-soft); text-align: center;
}
.ger-thumb.wide { width: 128px; }
.ger-thumb.empty { border: 1px dashed var(--line); }

/* ---------- リアクション通知 ---------- */
/* ユーザー名・ゲーム名は長さを制限していないため、スペースの無い連続文字列
   （英数字の名前など）が来ると .notif-body と違って折り返す指定が無く、
   そのぶん .screen-body の横幅を実際に押し広げていた（横スワイプでずれる
   不具合の実体の1つ）。折り返し方は .notif-body に合わせる。 */
.notif-act { font-size: 13px; line-height: 1.5; margin-top: 2px; word-break: break-word; }
.notif-act b { font-weight: 700; }
.notif-act .rx-gu { color: var(--gu); }
.notif-act .rx-boo { color: var(--boo); }
.notif-act .rx-follow { color: var(--gu); }
.notif-body.quiet { color: var(--ink-soft); font-size: 12px; }

/* ---------- グループのシステムメッセージ（役職の変更） ----------
   スレッドではないので、カードにせず中央寄せの1行にする。
   押しても何も起きない（レスもリアクションも付かない）。 */
.sys-msg {
  margin: 8px 12px; padding: 8px 12px; border-radius: 999px;
  background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); text-align: center;
  font-size: 12px; color: var(--ink-soft); line-height: 1.6;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.sys-msg .sys-text { font-weight: 700; }
.sys-msg .sys-time { font-size: 10px; opacity: .8; }

/* ---------- グループ作成時の招待システムメッセージ ----------
   役職変更の1行（.sys-msg）とは違い、招待URLとボタンを持つカード形式にする。
   投稿者名・アイコンは出さない（項目4）。 */
.sys-invite-msg {
  margin: 10px 12px; padding: 16px; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow); text-align: center;
}
.sys-invite-head { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.sys-invite-title { font-weight: 800; font-size: 14px; color: var(--ink); }
.sys-invite-head .sys-time { position: absolute; right: 0; font-size: 10px; color: var(--ink-soft); opacity: .8; }
.sys-invite-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 12px; }
.sys-invite-url {
  background: var(--orange-soft); color: var(--orange-dark); border: 1px solid var(--orange-border);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 600;
  word-break: break-all; margin-bottom: 12px;
}
.sys-invite-actions { display: flex; gap: 8px; }
.sys-invite-btn { flex: 1; padding: 11px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--ink); }
.sys-invite-btn.primary { background: var(--orange); color: #fff; }
.sys-invite-btn:active { opacity: .8; }

/* ---------- 案内バナー：Discord のとき ---------- */
.install-banner { position: relative; }
.install-banner.discord { border-color: #c9cdf5; }
/* 案内バナー：アカウント登録のとき（未登録の人にだけ出る） */
.install-banner.account { border-color: var(--orange-border); background: var(--orange-soft); }
.install-banner .ib-icon.glyph {
  display: flex; align-items: center; justify-content: center;
  background: #fff; font-size: 19px;
}
.install-banner .ib-cta.discord {
  background: #5865f2; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
}
.install-banner .ib-cta.discord:active { background: #4752c4; }
.install-banner .ib-dots {
  position: absolute; left: 0; right: 0; bottom: 3px;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.install-banner .ib-dots span {
  width: 4px; height: 4px; border-radius: 50%; background: rgba(0, 0, 0, 0.16);
}
.install-banner .ib-dots span.on { background: var(--orange); }

/* ---------- メンバー：リーダーにするボタン ---------- */
.sub-toggle.lead { border-color: #c9cdf5; color: #4752c4; }
.sub-toggle.lead:active { background: #eef0fe; }

/* ---------- お知らせの帯（上部バーの下を右から左へ流れる） ---------- */
.announce-bar {
  background: #2b2b2b; color: #ffd9bd; overflow: hidden; white-space: nowrap;
  font-size: 12px; line-height: 1.4; padding: 6px 0; position: relative; z-index: 4;
}
.announce-track { display: inline-block; padding-left: 100%; }
.announce-text { display: inline-block; padding-right: 3em; font-weight: 600; }
/* 右 → 左へ流す。画面の外（右）から入ってきて、左へ抜ける。
   track は padding-left: 100% で「帯の幅ぶんの余白＋本文」の長さになっている。
   animation-direction: reverse でキーフレームを逆再生し、0（余白ぶんだけ右にはみ出た
   状態＝本文は画面の右外）から -100%（本文が左外まで抜けた状態）へ動かす。 */
@keyframes announce-flow {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
.announce-track { animation: announce-flow 18s linear infinite reverse; }
@media (prefers-reduced-motion: reduce) {
  /* 動きを減らす設定の人には流さず、そのまま読めるようにする */
  .announce-track { animation: none; padding-left: 12px; }
  .announce-bar { white-space: normal; }
}

/* 開発者のマイグループにだけ出す入力フォーム */
.announce-form {
  margin: 12px 12px 0; padding: 12px; border-radius: 10px;
  background: var(--card); border: 1px dashed var(--ink-faint); box-shadow: var(--shadow);
}
.announce-head { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.announce-head .dev-only {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: #2b2b2b; color: #fff;
}
.announce-input { display: flex; gap: 8px; margin-top: 10px; }
.announce-input input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 18px;
  padding: 9px 14px; background: var(--surface-2); font-size: 14px;
}
.announce-input input:focus { outline: none; border-color: var(--orange); background: var(--surface-2); }
.announce-send {
  flex-shrink: 0; background: var(--orange); color: #fff; font-weight: 700;
  border-radius: 18px; padding: 9px 16px; font-size: 13px;
}
.announce-send:active { background: var(--orange-dark); }
.announce-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.announce-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  background: var(--surface-2); border-radius: 8px; padding: 7px 10px;
}
.announce-body { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce-x { width: 24px; height: 24px; border-radius: 50%; color: var(--icon-grey); flex-shrink: 0; }
.announce-x:active { background: var(--surface-press); }
.announce-empty { margin-top: 10px; font-size: 11px; color: var(--ink-soft); }

/* ---------- シャウト（開発者：全員に通知） ---------- */
.shout-note {
  font-size: 11px; color: var(--orange-dark); background: var(--orange-soft);
  padding: 6px 12px; text-align: center;
}
.notif-act .rx-shout { color: var(--orange-dark); }
.notif-act .rx-mention { color: var(--gu); }

/* ---------- 投稿禁止（BAN）の表示 ---------- */
.composer.locked.banned { color: var(--danger); font-weight: 600; }
.composer.locked.banned .ban-sub { color: var(--ink-soft); font-weight: 400; }
.mod-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mp-btn.danger-text { color: var(--danger); }
.toggle-row.wrap { flex-wrap: wrap; }
.toggle-row.wrap .opt { flex: 1 0 30%; }

/* ---------- 規約類へのリンク（マイページ下部） ---------- */
.legal-links {
  margin-top: 22px; text-align: center; font-size: 12px; color: var(--ink-soft);
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.legal-links a { color: var(--ink-soft); text-decoration: underline; }
.legal-links a:active { color: var(--orange-dark); }
.support-legal-links { margin-top: 14px; }
.legal-link-list { display: flex; flex-direction: column; }
.legal-link-list a {
  min-height: 48px; padding: 12px 2px; display: flex; align-items: center;
  border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; line-height: 1.5;
}
.legal-link-list a:last-child { border-bottom: 0; }
.legal-link-list a:active { color: var(--orange-dark); background: var(--orange-soft); }

/* ============================================================================
   2026-07-31 アップデートぶん
     タップの手応え / プル・トゥ・リフレッシュ / 通知ドロワー / レスへの返信 /
     プロフィール（ひとこと・バナー）/ 公開グループの並べ替え / 開発者表示
   ============================================================================ */

/* ---------- タップの手応え（項目3） ----------
   押したことが分かればよいので、いずれも「軽く・短く」に留める。
   ・背景色をほんの少し変える
   ・0.97 まで縮める（1〜2px 程度の沈み込みに相当）
   ・遷移そのものは遅らせない（transition は戻るときだけ効かせる）
   レイアウトが動かないよう transform だけで表現し、余白や高さは変えない。 */
.tapable { transition: background-color .12s ease, opacity .12s ease, transform .12s ease; }
.tapable:active {
  background-color: var(--surface-press);
  transform: scale(.985);
}
/* 一覧の行・カード（グループ / スレッド / ブックマーク / 通知 / 検索結果） */
.group-card, .thread-card .thread-body, .bm-item, .notif-item,
.user-search-row, .more-row, .block-list-row, .report-card {
  transition: background-color .12s ease, transform .12s ease;
}
.group-card:active { background: var(--surface-press); transform: scale(.99); }
.bm-item:active .thread-card { background: var(--surface-press); }
.notif-item:active { transform: scale(.995); }
.user-search-row:active, .block-list-user:active { background: var(--surface-press); }
.replies-preview:active { background: var(--surface-press); }
/* アイコン（ユーザー / グループ） */
.avatar[data-act], .more-face, .mp-face, .group-card .thumb {
  transition: opacity .12s ease, transform .12s ease;
}
.avatar[data-act]:active { opacity: .7; transform: scale(.93); }
.more-profile:active { background: #666a6d; }
/* 通常ボタン全般。個別に :active を持つものは、そちらが優先される。 */
.mp-btn:active, .cta-solid:active, .sheet-btn:active, .btn-create:active,
.iconbtn:active, .rbtn:active, .filter-x:active, .sub-toggle:active,
.bottom-nav-item:active, .tabbar .tab:active, .linklike:active {
  transform: scale(.97);
}
.tabbar .tab { transition: background-color .12s ease, transform .12s ease; }
.tabbar .tab:active { background: var(--orange-soft); }
.modal-actions button:active { transform: scale(.98); filter: brightness(.97); }
.toggle-row .opt:active, .report-reasons .opt:active { background: var(--surface-press); }
/* 動きを減らす設定の人には、縮小をやめて色の変化だけにする */
@media (prefers-reduced-motion: reduce) {
  .tapable, .group-card, .notif-item, .avatar[data-act], .more-face, .mp-face,
  .group-card .thumb, .tabbar .tab { transition: none; }
  .tapable:active, .group-card:active, .notif-item:active, .avatar[data-act]:active,
  .mp-btn:active, .cta-solid:active, .sheet-btn:active, .btn-create:active,
  .iconbtn:active, .rbtn:active, .filter-x:active, .sub-toggle:active,
  .bottom-nav-item:active, .tabbar .tab:active, .linklike:active,
  .modal-actions button:active { transform: none; }
  .notif-drawer, .modal, .modal-scrim, .zoom-scrim, .invite-panel, .invite-scrim { animation: none; }
}

/* ---------- プル・トゥ・リフレッシュ（項目4） ----------
   一覧のいちばん上で下へ引いたときだけ出る帯。高さは JS が引いた距離に応じて
   --ptr-h に入れる。レイアウトを押し下げないよう、内容の上に重ねて出す。 */
.ptr {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  height: var(--ptr-h, 0px);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden; pointer-events: none;
  font-size: 12px; font-weight: 700; color: var(--orange-dark);
  background: linear-gradient(180deg, rgba(255,241,232,.98), rgba(255,241,232,0));
}
.ptr .ptr-spin {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 127, 39, .3); border-top-color: var(--orange);
}
.ptr.spinning .ptr-spin { animation: spin .8s linear infinite; }
.ptr.error { color: var(--danger); background: linear-gradient(180deg, rgba(253,240,238,.98), rgba(253,240,238,0)); }
@media (prefers-reduced-motion: reduce) { .ptr.spinning .ptr-spin { animation-duration: 2s; } }

/* ---------- レスへの返信（項目6） ---------- */
/* ブックマークの右隣に並ぶリプライボタン。既存のバーの作りは変えない。 */
.reaction-bar .rbtn.reply-to.on { color: var(--orange-dark); }
/* 投稿入力欄の上に出る「返信モード」の帯 */
.reply-target {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; background: var(--orange-soft); border-bottom: 1px solid var(--orange-border);
}
.reply-target .rt-meta { flex: 1; min-width: 0; }
.reply-target .rt-to { font-size: 12px; font-weight: 700; color: var(--orange-dark); }
.reply-target .rt-body {
  font-size: 11px; color: var(--ink-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-target .rt-x {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  color: var(--orange-dark); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.reply-target .rt-x:active { background: #ffe0cb; }
/* 投稿に付く「↪ ○○さんへの返信」。押すと元のレスへ移動する。 */
.reply-ref {
  display: block; width: 100%; text-align: left;
  margin: 6px 12px 0; padding: 6px 10px; max-width: calc(100% - 24px);
  border-left: 3px solid var(--orange-border); border-radius: 0 8px 8px 0;
  background: var(--surface-2); font-size: 12px; color: var(--ink-soft); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 一覧のレスプレビューの中に出すときは、まわりの余白に合わせて詰める */
.reply-ref.sm { margin: 2px 0 0; max-width: 100%; padding: 3px 8px; font-size: 11px; }
.reply-ref:active { background: var(--surface-press); }
.reply-ref .rr-name { font-weight: 700; color: var(--orange-dark); }
.reply-ref.gone { border-left-color: var(--line); color: var(--ink-faint); }
/* 返信元へ飛んだときに一瞬光らせる（どこへ来たのか分かるように） */
.reply-item.flash { animation: replyflash 1.2s ease; }
@keyframes replyflash { from { background: var(--orange-soft); } to { background: var(--reply-bg); } }
@media (prefers-reduced-motion: reduce) { .reply-item.flash { animation: none; outline: 2px solid var(--orange); } }

/* ---------- プロフィール：ひとことメモ / 背景バナー（項目7） ---------- */
.mp-banner {
  position: relative; height: 112px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(120deg, #ffd9bd, #ffe9d8);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #a5764f; margin-bottom: 14px;
}
.mp-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-banner .mp-banner-busy {
  position: absolute; inset: 0; background: rgba(255, 255, 255, .72);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--orange-dark);
}
/* .ptr の中でだけ効く指定なので、ここでも同じ見た目を作っておく */
.mp-banner-busy .ptr-spin {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 127, 39, .3); border-top-color: var(--orange);
}
.mp-banner-err { font-size: 11px; color: var(--danger); line-height: 1.6; margin: -8px 0 14px; }
/* 長い文章・URL・英数字の羅列でも枠を押し広げない */
.mp-bio {
  font-size: 13px; line-height: 1.7; color: var(--ink); white-space: pre-wrap;
  word-break: break-word; overflow-wrap: anywhere;
}
.mp-bio.empty { color: var(--ink-soft); }

/* ---------- 自分のプロフィール編集画面（renderMyPage）----------
   バナー＋アイコンを「プレビュー」として上に、その下を編集フォームとして
   一体化したレイアウト。.mp-face / .mp-card / .follow-stats など他の画面
   （他ユーザーのプロフィール・設定画面等）と共有しているクラスは基底のまま
   触らず、この画面固有の見た目はすべて pe- 接頭辞の新しいクラスで作る。 */
.pe-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.pe-card .field { margin-bottom: 0; } /* 親の gap で間隔を作るので、field 自身の margin は打ち消す */

.pe-banner-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
/* aspect-ratio で先に領域を確保しておくので、画像の読み込み前後で高さが変わらない（項目14）。 */
.pe-banner {
  position: relative; width: 100%; aspect-ratio: 2.5 / 1;
  border-radius: 14px; overflow: hidden; background: var(--surface-2);
}
.pe-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-banner-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 12px; background: var(--surface-2);
}
.pe-banner-busy {
  position: absolute; inset: 0; background: rgba(255, 255, 255, .72);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--orange-dark);
}
.pe-banner-busy .ptr-spin {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 127, 39, .3); border-top-color: var(--orange);
}
/* 写真の上に浮かせる白いピル型ボタンなので、ライト/ダーク共通の見た目にする
   （下地がどんな色の写真でも視認できるように）。 */
.pe-banner-edit-btn {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #2b2b2b;
  font-size: 12px; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.pe-banner-edit-btn svg { width: 14px; height: 14px; }
.pe-banner-edit-btn:active { background: #fff; }

/* バナーの下端に、少し重なるようにアイコンを乗せる（マイナスマージンで引き上げる）。 */
/* position:relative がないと、position:relative な .pe-banner（先に書かれている）
   の方が塗り順で上に来てしまい、重なった部分のアイコン編集ボタンが
   バナー画像の下に隠れてしまう（position指定の無い要素は、position指定のある
   要素より先に塗られるため）。 */
.pe-identity-row { position: relative; display: flex; align-items: flex-end; gap: 14px; margin-top: -40px; padding: 0 2px; }
.pe-avatar-wrap { position: relative; flex-shrink: 0; }
.mp-face.lg {
  width: 104px; height: 104px; font-size: 38px;
  border: 4px solid var(--card); box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.pe-avatar-edit {
  position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: #fff; border: 3px solid var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.pe-avatar-edit svg { width: 14px; height: 14px; }
.pe-avatar-edit:active { background: var(--orange-dark); }

/* フォロー / フォロワー（編集画面だけの見た目。他ユーザーのプロフィール側の
   .follow-stats はここでは触らない）。 */
.pe-follow-stats {
  display: flex; align-items: stretch; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.pe-follow-stat {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--ink-soft);
}
.pe-follow-stat b { font-size: 17px; font-weight: 700; color: var(--ink); margin-right: 1px; }
.pe-follow-stat:active { opacity: .6; }
.pe-follow-icon { width: 18px; height: 18px; color: var(--ink-faint); flex-shrink: 0; }
.pe-follow-icon svg { width: 100%; height: 100%; fill: currentColor; }
.pe-follow-divider { width: 1px; background: var(--line); flex-shrink: 0; }

.pe-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pe-field-head label { margin-bottom: 0; }
.pe-count { font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }
.pe-count.over { color: var(--danger); font-weight: 700; }

/* アイコンの色：選択中は既存の白リングではなくオレンジのリングで示す
  （白リングは白いカードの上では見えにくいため。onboarding の .reg-body と同じ考え方）。 */
.pe-card .swatch.selected { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-soft); }

.pe-save-btn { padding: 17px; border-radius: 16px; font-size: 16px; margin-top: 4px; }
.pe-save-btn:disabled { opacity: .6; }

@media (max-width: 360px) {
  .mp-face.lg { width: 88px; height: 88px; font-size: 32px; }
  .pe-identity-row { gap: 10px; margin-top: -34px; }
}

/* ---------- 公開グループの並べ替え（項目9） ---------- */
.sort-row { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); font-size: 12px; font-weight: 700;
  box-shadow: var(--shadow);
}
.sort-btn:active { background: var(--orange-soft); color: var(--orange-dark); border-color: var(--orange-border); }
.sort-btn .sort-ico { font-size: 13px; }
.sheet-btn.chosen { background: var(--orange-soft); color: var(--orange-dark); }
.sheet-btn.chosen::after { content: ' ✓'; font-weight: 800; }

/* ---------- 開発者アカウントの目印（項目10） ----------
   表示名の先頭に付ける。DB の is_developer を見て描くので、
   自分で名前を「開発者」にしても同じ形にはならない。 */
.dev-mark {
  display: inline-block; vertical-align: middle; margin-right: 4px;
  font-size: 10px; font-weight: 800; line-height: 1.6; letter-spacing: .02em;
  padding: 0 6px; border-radius: 4px;
  background: linear-gradient(135deg, #2b2b2b, #4a4a4a); color: #ffd9bd;
}
.dev-mark.sm { font-size: 9px; padding: 0 5px; }

/* ---------- その他タブ：アカウント案内 / 開発者向け（項目2-2・11） ---------- */
.more-account {
  margin: 18px 14px 0; padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.more-account.anon { border-color: var(--orange-border); background: var(--orange-soft); }
.more-account h2 { margin: 0 0 8px; font-size: 15px; }
.more-account.anon h2 { color: var(--orange-dark); }
.more-account p { margin: 0 0 12px; font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.more-account.anon p { color: #8a5a33; }
.more-account .mp-btn.wide { margin-bottom: 8px; }
.more-account .mp-btn.wide:last-child { margin-bottom: 0; }
.more-account-state {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: #2e8b57;
}
.more-account-mail {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2);
  font-size: 12px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 開発者向け。通常の項目とはっきり分け、目立たない見た目にして下端へ置く。 */
.more-dev { margin: 26px 14px 20px; }
.more-dev-label {
  font-size: 10px; font-weight: 700; color: var(--ink-faint); letter-spacing: .08em;
  padding: 0 4px 6px;
}
.more-dev-row {
  width: 100%; padding: 12px 14px; text-align: left;
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--line); border-radius: 10px; background: transparent;
  font-size: 13px; color: var(--ink-faint);
}
.more-dev-row:active { background: var(--surface-press); }
.more-dev-row .more-dev-state { margin-left: auto; font-size: 11px; font-weight: 700; }
.more-dev-row.on { border-style: solid; border-color: #2b2b2b; color: #2b2b2b; }
.more-dev-row.on .more-dev-state { color: var(--orange-dark); }

/* ---------- 未ログイン（ゲスト）まわり ---------- */
/* ホーム上部：新規登録・ログインの入口を分かりやすく出す帯 */
.guest-auth-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; background: var(--orange-soft); border-bottom: 1px solid var(--orange-border);
}
.guest-auth-label { font-size: 12px; font-weight: 700; color: var(--orange-dark); }
.guest-auth-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.guest-auth-actions .linklike { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.guest-auth-cta {
  padding: 7px 14px; border-radius: 999px; background: var(--orange); color: #fff;
  font-size: 12px; font-weight: 700; border: none; white-space: nowrap; flex-shrink: 0;
}
.guest-auth-cta:active { background: var(--orange-dark); }
/* 「その他」タブのゲスト版 */
.more-account.guest { text-align: center; border-color: var(--orange-border); background: var(--orange-soft); }
.more-guest-mark { width: 52px; height: 52px; display: block; margin: 0 auto 10px; object-fit: contain; border-radius: 12px; }
.more-account.guest h2 { color: var(--orange-dark); font-size: 16px; }
.more-account.guest p { color: #8a5a33; text-align: center; }
.more-account.guest .cta-solid { margin-bottom: 8px; }

/* ---------- 新規登録 / ログイン / 確認コードページ（/signup, /login, /verify-email） ---------- */
.auth-page-topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.auth-page-topbar .title { flex: 1; text-align: center; }
.auth-page-topbar .title h1 { font-size: 16px; margin: 0; }
.auth-page-body { display: flex; flex-direction: column; padding: 28px 20px max(28px, env(safe-area-inset-bottom)); }
.auth-card-wrap { width: 100%; max-width: 360px; margin: 0 auto; text-align: center; }
.auth-page-logo { width: 44px; height: 44px; display: block; margin: 0 auto 14px; object-fit: contain; border-radius: 10px; }
.auth-page-heading { font-size: 21px; font-weight: 800; margin: 0 0 4px; }
.auth-page-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 22px; line-height: 1.6; }
.auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; text-align: left;
}
.auth-card .field:last-of-type { margin-bottom: 10px; }
.field-error { font-size: 11px; color: var(--danger); margin-top: 4px; font-weight: 600; }
.auth-agree-row {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
  font-size: 12px; line-height: 1.6; color: var(--ink); margin: 4px 0 4px;
}
.auth-agree-row input[type="checkbox"] { margin-top: 2px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--orange); }
.auth-agree-row a { color: var(--orange-dark); font-weight: 700; }
.auth-page-cta { width: 100%; padding: 14px; border-radius: 12px; border: none; background: var(--orange); color: #fff; font-weight: 800; font-size: 15px; margin-top: 6px; }
.auth-page-cta:active { background: var(--orange-dark); }
.auth-page-cta:disabled { background: #cfd3d6; }
.auth-page-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--ink-soft); font-size: 11px; }
.auth-page-divider::before, .auth-page-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-forgot-link { display: block; text-align: center; margin-top: 10px; font-size: 12px; }
.auth-page-switch { margin-top: 20px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.auth-page-switch .linklike { font-weight: 700; color: var(--orange-dark); }
.auth-page-hint { font-size: 11px; color: var(--ink-soft); line-height: 1.6; margin: -4px 0 12px; }
@media (min-width: 640px) {
  .auth-page-body { padding-top: 48px; }
}

/* ---------- 認証案内ボトムシート（AuthRequiredSheet） ---------- */
.auth-sheet {
  padding-top: 10px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  text-align: center; position: relative;
}
.auth-sheet:focus { outline: none; }
.auth-sheet-handle {
  width: 40px; height: 4px; border-radius: 999px; background: var(--line);
  margin: 0 auto 14px;
}
.auth-sheet-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 999px; border: none; background: var(--surface-2); color: var(--ink-soft);
  font-size: 14px; line-height: 1;
}
.auth-sheet-close:active { background: var(--surface-press); }
.auth-sheet-mark { width: 48px; height: 48px; display: block; margin: 4px auto 12px; object-fit: contain; border-radius: 11px; }
.auth-sheet h2 { margin: 0 0 8px; font-size: 17px; }
.auth-sheet-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin: 0 0 20px; }
.auth-sheet-primary { width: 100%; padding: 14px; border-radius: 12px; border: none; background: var(--orange); color: #fff; font-weight: 800; font-size: 15px; }
.auth-sheet-primary:active { background: var(--orange-dark); }
.auth-sheet-secondary {
  width: 100%; margin-top: 10px; padding: 13px; border-radius: 12px; border: 1.5px solid var(--orange);
  background: var(--card); color: var(--orange-dark); font-weight: 700; font-size: 14px;
}
.auth-sheet-secondary:active { background: var(--orange-soft); }
.auth-sheet-later {
  display: block; width: 100%; margin-top: 14px; padding: 6px; border: none; background: none;
  color: var(--ink-soft); font-size: 13px;
}

/* ---------- PC専用レイアウト（900px以上） ---------- */
@media (min-width: 900px) {
  html, body { overflow: hidden; background: var(--bg); }
  body { display: block; }
  .phone { width: 100vw; max-width: none; height: 100dvh; box-shadow: none; }
  .desktop-shell {
    --desktop-nav-w: 76px;
    width: 100%; height: 100%; min-width: 0; display: grid;
    grid-template-columns: var(--desktop-nav-w) minmax(0, 1fr); background: var(--bg);
  }
  .desktop-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .desktop-content { min-width: 0; min-height: 0; flex: 1; display: flex; overflow: hidden; }
  .desktop-columns {
    min-width: 0; min-height: 0; flex: 1; display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); overflow: hidden;
  }
  .desktop-columns.no-groups { grid-template-columns: minmax(0, 1fr); }

  .desktop-navigation {
    min-width: 0; min-height: 0; padding: 10px 8px 12px; background: var(--card);
    border-right: 1px solid var(--line); display: flex; flex-direction: column;
    position: relative; z-index: 8;
  }
  .desktop-nav-links { display: flex; flex-direction: column; gap: 6px; }
  .desktop-nav-item {
    width: 100%; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px;
    border-radius: 12px; color: var(--ink-soft); font-size: 10px; font-weight: 750; text-align: center;
  }
  .desktop-nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .desktop-nav-item.active { color: var(--orange-dark); background: var(--orange-soft); box-shadow: inset 3px 0 0 var(--orange); }
  .desktop-nav-icon { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; position: relative; }
  .desktop-nav-icon svg { width: 24px; height: 24px; fill: currentColor; }
  .desktop-create {
    width: 48px; height: 48px; margin: 24px auto 0; border-radius: 16px; display: grid; place-items: center;
    background: var(--orange); color: #fff; font-size: 27px; font-weight: 500; box-shadow: 0 5px 14px rgba(255, 127, 39, .24);
  }
  .desktop-create:hover { background: var(--orange-dark); }

  .desktop-global-header {
    flex: 0 0 60px; min-width: 0; padding: 8px 18px; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(280px, 560px) minmax(120px, 1fr); align-items: center; gap: 18px;
    background: var(--orange); color: #fff; border-bottom: 1px solid rgba(0,0,0,.06); z-index: 7;
  }
  .desktop-header-title { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
  .desktop-header-title strong { font-size: 21px; font-weight: 900; letter-spacing: .01em; }
  .desktop-header-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 750; opacity: .94; }
  .desktop-search-launch {
    width: 100%; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
    border-radius: 12px; background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.55); color: #666; text-align: left;
  }
  .desktop-search-launch svg { width: 19px; height: 19px; fill: currentColor; opacity: .78; }
  .desktop-search-launch:hover { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
  .desktop-header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
  .desktop-global-header .iconbtn { color: #fff; }
  .desktop-global-header .iconbtn:hover { background: rgba(255,255,255,.18); }
  .desktop-header-account { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; font-weight: 700; }
  .desktop-header-account:hover { background: rgba(255,255,255,.16); }
  .desktop-login { padding: 9px 15px; border-radius: 9px; background: #fff; color: var(--orange-dark); font-weight: 800; }

  .desktop-group-panel {
    min-width: 0; min-height: 0; background: var(--card); border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
  }
  .desktop-group-tabs { flex: 0 0 48px; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
  .desktop-group-tab { min-width: 0; min-height: 48px; padding: 0 10px; color: var(--ink-soft); font-size: 12px; font-weight: 750; border-bottom: 3px solid transparent; }
  .desktop-group-tab:hover { background: var(--surface-press); color: var(--ink); }
  .desktop-group-tab.active { color: var(--orange-dark); border-bottom-color: var(--orange); }
  .desktop-group-filter {
    flex: 0 0 38px; margin: 12px 12px 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
    display: flex; align-items: center; gap: 6px; color: var(--ink-soft); background: var(--surface-2);
  }
  .desktop-group-filter:focus-within { border-color: var(--orange); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(255, 127, 39, .12); }
  .desktop-group-filter input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
  .desktop-group-count { padding: 4px 14px 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
  .desktop-group-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 18px; }
  .desktop-group-scroll .group-card { margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); box-shadow: none; cursor: pointer; }
  .desktop-group-scroll .group-card:hover { border-color: var(--orange-border); background: var(--surface-2); }
  .desktop-group-scroll .group-card.selected { background: var(--orange-soft); border-color: var(--orange-border); box-shadow: inset 3px 0 0 var(--orange); }
  .desktop-group-scroll .group-card .thumb { width: 46px; height: 46px; }
  .desktop-group-scroll .group-card .meta .stats { gap: 7px; }
  .desktop-empty, .desktop-side-empty { padding: 22px 12px; color: var(--ink-soft); font-size: 12px; text-align: center; line-height: 1.6; }

  .desktop-feed-column, .desktop-home-main {
    min-width: 0; min-height: 0; background: var(--bg); display: flex; flex-direction: column; position: relative;
  }
  .desktop-group-header {
    flex: 0 0 66px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--card); border-bottom: 1px solid var(--line); z-index: 4;
  }
  .desktop-feed-column > .group-content-tabs { padding-inline: 16px; }
  .desktop-group-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; background-size: cover !important; background-position: center !important; display: grid; place-items: center; color: #fff; font-weight: 800; }
  .desktop-group-title {
    min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  }
  .desktop-group-title strong { max-width: 100%; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .desktop-group-title span { color: var(--ink-soft); font-size: 11px; }
  .desktop-group-title:hover, .desktop-group-title:focus-visible { border-color: var(--orange-border); background: var(--orange-soft); }
  .desktop-group-title:hover strong { color: var(--orange-dark); }
  .desktop-group-actions { display: flex; align-items: center; gap: 2px; }
  .desktop-group-actions .iconbtn, .desktop-icon-btn { color: var(--ink-soft); }
  .desktop-group-actions .iconbtn:hover, .desktop-icon-btn:hover { color: var(--orange-dark); background: var(--orange-soft); }
  .desktop-icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; }
  .desktop-feed-tabs { flex: 0 0 48px; display: flex; background: var(--card); border-bottom: 1px solid var(--line); padding-left: 12px; }
  .desktop-feed-tabs button { min-width: 84px; padding: 0 14px; color: var(--ink-soft); font-size: 13px; font-weight: 750; border-bottom: 3px solid transparent; }
  .desktop-feed-tabs button:hover { color: var(--ink); background: var(--surface-press); }
  .desktop-feed-tabs button.active { color: var(--orange-dark); border-bottom-color: var(--orange); }
  .desktop-feed-scroll, .desktop-home-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .desktop-feed-scroll .thread-list { width: min(100%, 780px); margin: 0 auto; padding: 14px 16px 32px; }
  .desktop-feed-scroll .thread-card { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
  .desktop-feed-scroll .post-img-wrap { max-width: 640px; margin-inline: auto; }
  .desktop-feed-scroll .post-img-grid { width: min(100%, 560px); }
  .desktop-feed-column .group-scroll-top { right: 20px; bottom: 86px; }
  .desktop-feed-column > .composer-wrap, .desktop-feed-column > .composer { flex: 0 0 auto; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .04); z-index: 4; }
  .desktop-feed-column .composer { padding: 10px 14px; }
  .desktop-feed-column .composer textarea { min-height: 38px; }
  .desktop-home-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; padding: 32px; color: var(--ink-soft); text-align: center; }
  .desktop-home-empty > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--orange-soft); color: var(--orange); font-size: 28px; font-weight: 900; }
  .desktop-home-empty h1 { margin: 16px 0 6px; color: var(--ink); font-size: 20px; }
  .desktop-home-empty p { max-width: 420px; margin: 0; font-size: 13px; line-height: 1.7; }
  .desktop-discover-content { width: min(100%, 1100px); margin: 0 auto; padding: 4px 18px 40px; }
  .desktop-discover-content .discover-rail-box { min-height: 0; }
  .desktop-discover-content .discover-rail {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
    overflow: visible; padding: 4px 12px 10px;
  }
  .desktop-discover-content .discover-card {
    width: 100%; height: auto; min-height: 176px; padding: 14px 12px; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.05);
  }
  .desktop-discover-content .discover-card:hover { border-color: var(--orange-border); background: var(--orange-soft); transform: translateY(-1px); }
  .desktop-discover-content .discover-card .dc-thumb { width: 72px; height: 72px; }
  .desktop-discover-content .discover-section { margin-top: 22px; }
  .desktop-discover-content .discover-head { padding-inline: 12px; }
  .desktop-discover-content .discover-title { font-size: 16px; }
  .desktop-discover-content .trending-list { box-shadow: 0 2px 8px rgba(0,0,0,.05); border: 1px solid var(--line); }
  .desktop-discover-content .trending-row { min-height: 66px; padding: 13px 16px; }
  .desktop-discover-content .trending-row:hover { background: var(--orange-soft); }
  .desktop-skeleton-list { display: grid; gap: 12px; }
  .desktop-skeleton-list div { height: 180px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-press) 40%, var(--surface-2) 65%); background-size: 300% 100%; animation: desktop-skeleton 1.4s ease infinite; }
  @keyframes desktop-skeleton { to { background-position: -100% 0; } }

  .desktop-info-sidebar { display: none; min-width: 0; min-height: 0; padding: 12px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-left: 1px solid var(--line); }
  .desktop-side-section { margin-bottom: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
  .desktop-side-section h2, .desktop-info-sidebar > h2 { margin: 0 0 10px; font-size: 14px; }
  .desktop-side-section p, .desktop-info-sidebar > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
  .desktop-side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .desktop-side-button { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: 11px; font-weight: 750; }
  .desktop-side-button:hover { border-color: var(--orange); color: var(--orange-dark); }
  .desktop-side-button.primary { background: var(--orange-soft); border-color: var(--orange-border); color: var(--orange-dark); }
  .desktop-side-button.wide { width: 100%; margin-top: 9px; }
  .desktop-side-section dl { margin: 0; display: grid; gap: 8px; }
  .desktop-side-section dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
  .desktop-side-section dt { color: var(--ink-soft); }
  .desktop-side-section dd { margin: 0; text-align: right; }
  .desktop-member-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
  .desktop-member-row > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-member-row i { width: 8px; height: 8px; border-radius: 50%; background: #2ca56c; }
  .desktop-popular-row { width: 100%; display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
  .desktop-popular-row:hover span { color: var(--orange-dark); }
  .desktop-popular-row b { color: var(--orange); }
  .desktop-popular-row span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
  .desktop-popular-row small { color: var(--ink-soft); font-size: 9px; }
  .desktop-welcome { padding: 20px; }
  .desktop-info-trigger { display: grid; }

  .desktop-utility-panel {
    flex: 0 0 400px; min-width: 0; min-height: 0; display: flex; flex-direction: column;
    background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.08); z-index: 6;
    animation: slidein .18s ease;
  }
  .desktop-utility-head {
    flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 18px;
    border-bottom: 1px solid var(--line); color: var(--ink); font-size: 16px;
  }
  .desktop-utility-head button { width: 40px; height: 40px; border-radius: 50%; color: var(--ink-soft); }
  .desktop-utility-head button:hover { background: var(--orange-soft); color: var(--orange-dark); }
  .desktop-utility-panel > .notif-list, .desktop-more-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .desktop-more-scroll { padding-bottom: 24px; }
  .desktop-utility-panel .notif-item { min-height: 72px; padding: 13px 14px; cursor: pointer; }
  .desktop-utility-panel .notif-item:hover { background: var(--surface-2); }
  .desktop-shell.utility-open .desktop-info-sidebar { display: none; }
  .desktop-shell.utility-open .desktop-columns { grid-template-columns: minmax(0, 1fr); }
  .desktop-shell.utility-open .desktop-group-panel { display: none; }

  .desktop-shell button:focus-visible, .desktop-shell input:focus-visible, .desktop-shell textarea:focus-visible {
    outline: 3px solid rgba(255, 127, 39, .35); outline-offset: 2px;
  }

  /* モーダル／シート：モバイルは画面下から立ち上がるボトムシート（全幅）だが、
     PC用の上書きが無かったため、1920px幅の画面では横いっぱいに広がった
     ボトムシートがそのまま出ていた（「つくる」ボタンが画面幅いっぱいになる）。
     PCでは中央のダイアログとして出す。幅は Content max-width と揃えた 560px。 */
  .modal-scrim { align-items: center; justify-content: center; padding: 24px; }
  .modal {
    width: min(560px, 100%); border-radius: 16px;
    max-height: min(86vh, 760px); animation: fade .15s ease;
  }
}

@media (min-width: 1180px) {
  .desktop-columns { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) 300px; }
  .desktop-columns.no-groups { grid-template-columns: minmax(0, 1fr); }
  .desktop-info-sidebar { display: block; }
  .desktop-info-trigger { display: none; }
}

@media (min-width: 1440px) {
  .desktop-columns { grid-template-columns: 320px minmax(0, 1fr) 320px; }
  .desktop-columns.no-groups { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1680px) {
  .desktop-shell.utility-open .desktop-columns:not(.no-groups) { grid-template-columns: 300px minmax(0, 1fr); }
  .desktop-shell.utility-open .desktop-group-panel { display: flex; }
}

/* ---------- 見つける（発見ホーム） ---------- */
/* ヘッダー直下の検索バー。押すと公開グループの縦一覧へ切り替わる。 */
.discover-search-launch { padding: 10px 12px 2px; background: var(--bg); }
.ds-launch-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink-soft); font-size: 13px; text-align: left;
}
.ds-launch-btn:active { background: var(--surface-press); }
.ds-launch-btn .ds-ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--icon-grey); }
.ds-launch-btn .ds-ico svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.ds-launch-btn .ds-ph { flex: 1; min-width: 0; }

/* 案内パネル（常に1枚だけ）。中身の見た目はホーム上部のバナーと共通。 */
.discover-banner .install-banner { margin-bottom: 4px; }

.discover-section { margin-top: 14px; }
.discover-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 0 12px 8px;
}
.discover-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.discover-empty {
  margin: 0 12px; padding: 20px 14px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  color: var(--ink-soft); font-size: 12px; line-height: 1.7; text-align: center;
}

/* おすすめ / 新着 / 更新順 の切り替え。選択中はHapiのオレンジ。 */
.discover-seg { display: flex; gap: 8px; padding: 0 12px 10px; }
.discover-seg-btn {
  flex: 1; padding: 9px 0; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
}
.discover-seg-btn.active {
  background: var(--orange); border-color: var(--orange); color: #fff;
}
.discover-seg-btn:active { opacity: .85; }

/* グループの棚（横スクロール）。
   おすすめ・新着・更新順のどれを出しても、また0件で空の案内になっても、
   この箱の高さは変わらない（＝下の「注目のスレッド」が上下に動かない）。
   カード1枚ぶんの高さを1か所で決めて、箱の min-height もそこから出す。 */
.discover-rail-box {
  display: flex;
  min-height: calc(var(--discover-card-h) + 6px); /* .discover-rail の上下パディング */
}
.discover-rail {
  flex: 1; min-width: 0;
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 12px 4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.discover-rail::-webkit-scrollbar { display: none; }
.discover-rail { scrollbar-width: none; }
/* 0件のとき。カードと同じ高さの箱いっぱいに広がり、中央に案内を出す。 */
.discover-rail-empty {
  flex: 1; min-width: 0; margin: 2px 12px 4px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  color: var(--ink-soft); font-size: 12px; line-height: 1.7;
}
.discover-card {
  flex: 0 0 auto; width: 104px; height: var(--discover-card-h); scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 8px 12px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); text-align: center;
}
.discover-card:active { background: var(--surface-press); }
.discover-card .dc-thumb {
  width: 60px; height: 60px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
  background-size: cover; background-position: center;
}
.discover-card .dc-thumb.has-img { color: transparent; }
/* 名前は1行でも2行ぶんの場所を取る（カードごとに高さが変わらないように）。 */
.discover-card .dc-name {
  font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--ink);
  height: calc(12px * 1.35 * 2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; word-break: break-word;
}
.discover-card .dc-name .hapi-verified-badge-btn { vertical-align: -2px; }
.discover-card .dc-game {
  font-size: 10px; line-height: 1.4; font-weight: 700; color: var(--orange-dark);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.discover-card .dc-members { font-size: 10px; line-height: 1.4; color: var(--ink-soft); }

/* 注目のスレッド（ランキング）。 */
.trending-list {
  margin: 0 12px; border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow);
}
.trending-row {
  width: 100%; display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line);
}
.trending-row:last-child { border-bottom: none; }
.trending-row:active { background: var(--orange-soft); }
.trending-row .tr-rank {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange-soft); color: var(--orange-dark);
  font-size: 12px; font-weight: 700;
}
.trending-row .tr-main { flex: 1; min-width: 0; display: block; }
.trending-row .tr-title {
  display: block; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trending-row .tr-meta,
.trending-row .tr-score {
  display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* スレッドの色分けは、ブックマーク一覧と同じく左の細い帯で表す。 */
.trending-row.thread-color-red     { box-shadow: inset 3px 0 0 #ff5c3d; }
.trending-row.thread-color-green   { box-shadow: inset 3px 0 0 #00c853; }
.trending-row.thread-color-blue    { box-shadow: inset 3px 0 0 #2979ff; }
.trending-row.thread-color-purple  { box-shadow: inset 3px 0 0 #9c4dff; }
.trending-row.thread-color-black   { box-shadow: inset 3px 0 0 #2b2b2b; }

/* Hapi運営設定はタブが4つになり、狭い端末では文字が折り返してしまう。
   横に流して読めるようにする（他の2タブ・3タブの画面は今までどおり等分）。 */
.dev-settings-tabs { overflow-x: auto; scrollbar-width: none; }
.dev-settings-tabs::-webkit-scrollbar { display: none; }
.dev-settings-tabs .tab { flex: 0 0 auto; white-space: nowrap; padding: 12px 14px; }


/* ============================================================================
   ダークテーマ：個別の淡色（バッジ・警告色・ブランドボタン等）の上書き
   ----------------------------------------------------------------------------
   ここまでの共通トークン（--bg / --card / --surface-2 / --ink 等）だけでは
   足りない、一色ずつハードコードされた淡いパステル背景・縁取り・文字色をまとめる。
   ライトテーマ側のルールは一切変更していない（[data-theme="dark"] を頭に付けた
   別ルールとして上書きするだけで、元のルールの中身はそのまま）。
   ============================================================================ */

/* ---- スレッドの色分け ----
   トークン方式（--tc-*）に変更し、鮮やかな固定グラデーションはライト/ダーク
   共通の見た目にしたため、ここでの個別上書きは不要になった。 */

/* ---- 役職バッジ・サブリーダー切り替え（青系） ---- */
[data-theme="dark"] .role-badge.sub { background: rgba(78, 155, 255, 0.16); color: #7fb2ff; border-color: rgba(78, 155, 255, 0.4); }
[data-theme="dark"] .sub-toggle.active { background: rgba(78, 155, 255, 0.16); color: #7fb2ff; border-color: rgba(78, 155, 255, 0.4); }
[data-theme="dark"] .sub-toggle.lead { border-color: rgba(88, 101, 242, 0.5); color: #9aa4ff; }
[data-theme="dark"] .sub-toggle.lead:active { background: rgba(88, 101, 242, 0.16); }
[data-theme="dark"] .ios-share { background: rgba(78, 155, 255, 0.16); color: #7fb2ff; }

/* ---- Discord バナーの縁取り ---- */
[data-theme="dark"] .install-banner.discord { border-color: rgba(88, 101, 242, 0.5); }

/* ---- 各社ブランドの登録・ログインボタン ----
   Apple（黒地）・Discord（blurple）はそのままでも暗い背景に馴染むが、
   Apple は縁取りが無いとページと同化するので薄い境界線を足す。
   Google は公式のダークテーマ配色（暗いグレー地・淡いグレー文字）に合わせる。 */
[data-theme="dark"] .mp-btn.oauth-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
[data-theme="dark"] .mp-btn.oauth-google:active { background: #1e1f20; }
[data-theme="dark"] .mp-btn.oauth-apple { border: 1px solid rgba(255, 255, 255, 0.16); }

/* ---- 支援ページ：結果メッセージ・エラー ---- */
[data-theme="dark"] .support-result.success { background: rgba(46, 158, 68, 0.16); color: #6fd08f; }
[data-theme="dark"] .support-result.cancel { background: rgba(240, 180, 40, 0.16); color: #e0b25c; }
[data-theme="dark"] .support-result .support-result-icon { background: var(--card); color: #6fd08f; }
[data-theme="dark"] .support-error, [data-theme="dark"] .support-meter-form-error { background: rgba(255, 90, 60, 0.16); color: #ff8a75; }

/* ---- 警告・危険系の淡色ボックス（本文の色は var(--danger) のまま） ---- */
[data-theme="dark"] .ext-link-modal .ext-link-danger { background: rgba(255, 90, 60, 0.16); border-color: rgba(255, 90, 60, 0.4); }
[data-theme="dark"] .auth-msg { background: rgba(255, 90, 60, 0.14); }
[data-theme="dark"] .up-blocked { background: rgba(255, 90, 60, 0.16); }
[data-theme="dark"] .danger-btn { background: rgba(255, 90, 60, 0.14); border-color: rgba(255, 90, 60, 0.4); }
[data-theme="dark"] .danger-btn:active { background: rgba(255, 90, 60, 0.24); }
[data-theme="dark"] .block-list-note { background: rgba(255, 170, 60, 0.14); border-color: rgba(255, 170, 60, 0.4); color: #e0b98a; }

/* ---- オンライン表示・成功系（緑） ---- */
[data-theme="dark"] .follow-online { color: #5ecb8a; }
[data-theme="dark"] .online-dot { background: #5ecb8a; }
[data-theme="dark"] .account-saved { background: rgba(46, 158, 68, 0.16); color: #5ecb8a; }
[data-theme="dark"] .push-setting .ps-state.on { color: #5ecb8a; }
[data-theme="dark"] .more-account-state { color: #5ecb8a; }
[data-theme="dark"] .desktop-member-row i { background: #5ecb8a; }
[data-theme="dark"] .follow-state { background: rgba(46, 158, 68, 0.16); color: #5ecb8a; }

/* ---- オレンジ淡色カード上の補助テキスト（account-nudge / mp-card.accent 等） ---- */
[data-theme="dark"] .account-nudge p,
[data-theme="dark"] .mp-card.accent .acct-note,
[data-theme="dark"] .more-account.anon p,
[data-theme="dark"] .more-account.guest p { color: #d9a875; }

/* ---- プロフィール背景バナー（未設定時のプレースホルダー） ---- */
[data-theme="dark"] .mp-banner { background: linear-gradient(120deg, rgba(217, 107, 43, 0.22), rgba(217, 107, 43, 0.08)); color: var(--ink-soft); }
[data-theme="dark"] .mp-banner .mp-banner-busy { background: rgba(0, 0, 0, 0.55); }
/* その他タブ上部：バナー未設定時の代わりの地色（既定は #727578） */
[data-theme="dark"] .more-profile { background: #3a3c3e; }
[data-theme="dark"] .more-profile:active { background: #333537; }

/* ---- 開発者向けの黒バッジ（そのままだとページと同化するので少し明るく） ---- */
[data-theme="dark"] .badge-dev,
[data-theme="dark"] .announce-head .dev-only,
[data-theme="dark"] .support-meter-form-head .dev-only { background: #3a3a3a; }
/* 「その他」タブの開発者行：ON状態の縁取り・文字（元は #2b2b2b で黒地に同化していた） */
[data-theme="dark"] .more-dev-row.on { border-color: var(--ink); color: var(--ink); }

/* ---- Hapi公認バッジの説明シート等、白円アイコンの土台 ---- */
[data-theme="dark"] .install-banner .ib-icon.glyph { background: var(--card); }

/* ---- ヘッダー（.topbar） ----
   ライトテーマはブランドカラーのオレンジ一色で塗るが、ダークでは彩度の高い
   オレンジが常時視界に入り続けて疲れるため、他の面と同じダーク面（--bg-base）
   へ変える。オレンジはロゴ・選択中タブ・CTA等のアクセントだけに絞る。
   アイコン・タイトルボタンの縁取りは白半透明のオーバーレイのままでよい
   （オレンジ地でもダーク地でも同じように馴染むため、rgba(255,255,255,x) 側は
   変更していない）。 */
[data-theme="dark"] .topbar {
  background: var(--bg-base);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .topbar .title .sub { color: var(--ink-soft); }
[data-theme="dark"] .iconbtn { color: var(--ink-soft); }
[data-theme="dark"] .iconbtn:active { background: var(--surface-press); }
[data-theme="dark"] .topbar .bell.on,
[data-theme="dark"] .topbar .share-btn.on { background: var(--surface-press); color: var(--orange); }
[data-theme="dark"] .topbar .avatar.topbar-me { border-color: var(--line); }
[data-theme="dark"] .dev-chip { color: var(--ink-soft); }
[data-theme="dark"] .dev-chip.on { background: var(--orange); color: #fff; border-color: var(--orange); }
[data-theme="dark"] .dev-chip:active { background: var(--surface-press); }

/* ---- 下部ナビゲーション ----
   上罫線のオレンジも彩度を落とし、選択アイコン色だけで状態が伝わるよう弱める。 */
[data-theme="dark"] .bottom-nav { background: var(--bg-base); border-top-color: rgba(217, 107, 43, 0.65); }
/* 未選択は --ink-soft（本文の補足テキストと同じ濃さ）より一段淡い --ink-faint にし、
   選択中のオレンジとの差をはっきりさせる。 */
[data-theme="dark"] .bottom-nav-item { color: var(--ink-faint); }
[data-theme="dark"] .bottom-nav-item.active { color: var(--orange); }
[data-theme="dark"] .bottom-nav-item:active { background: var(--surface-press); }
[data-theme="dark"] .bottom-badge { border-color: var(--bg-base); }

/* ---- タブ（マイグループ／公開グループ／ブックマーク、デスクトップの各タブ） ----
   文字色とアンダーラインの両方をオレンジにする二重強調をやめ、選択状態は
   アンダーラインを主役にして文字は白寄りにする。未選択も --ink-faint へ揃える。 */
[data-theme="dark"] .tabbar .tab { color: var(--ink-faint); }
[data-theme="dark"] .tabbar .tab.active { color: var(--ink); }
[data-theme="dark"] .desktop-group-tab.active,
[data-theme="dark"] .desktop-feed-tabs button.active { color: var(--ink); }

/* ---- 「お知らせを流す」入力欄 ---- */
[data-theme="dark"] .announce-form { border-color: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] .announce-input input { background: var(--bg-base); border-color: rgba(255, 255, 255, 0.08); }

/* ---- .phone の外側（PCでウィンドウ幅が広いときの余白部分） ----
   data-theme は <html> に立てるので、html 自身と、その子孫の body の
   両方をここで指定する（body { background } の記述はここだけ）。
   完全な黒 (#000/#050505) は大面積で使うと目が疲れるため、他の面と同じ
   --bg-base（青み・紫みを含むダークグレー）に合わせる。 */
html[data-theme="dark"], html[data-theme="dark"] body { background: var(--bg-base); }

/* ---- 見た目が既に暗い/黒背景のUI（画像ビューア・トリミング画面・起動画面の
   縦画面ロック案内・トースト通知）はテーマに関わらずそのまま。変更なし。 ---- */
