/* ===== むすび (Musubi) ===== */

:root {
  --brand: #7c5cff;
  --brand-soft: #efeaff;
  --accent-anon: #ff8a3d;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #1b1e28;
  --text-sub: #6b7280;
  --border: #e3e6ec;
  --danger: #e5484d;
  --success: #2ecc71;
  --bubble-mine: #a4e57a;
  --bubble-mine-text: #17240c;
  --bubble-theirs: #ffffff;
  --shadow: 0 1px 3px rgba(20, 24, 40, .08);
  --nav-h: 58px;
  --header-h: 52px;
}
[data-theme="dark"] {
  --brand: #967dff;
  --brand-soft: #2b2543;
  --accent-anon: #ff9d5c;
  --bg: #12141c;
  --surface: #1c1f2b;
  --surface-2: #262a38;
  --text: #e8eaf2;
  --text-sub: #9aa1b5;
  --border: #303546;
  --bubble-mine: #4e7d33;
  --bubble-mine-text: #eaf6df;
  --bubble-theirs: #262a38;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overscroll-behavior-y: none;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
a { color: var(--brand); text-decoration: none; }

/* ===== 認証 ===== */
.auth-screen {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--brand) 0%, #5a3df0 60%, #3f2bb8 100%);
  padding: 20px;
}
.auth-card {
  background: var(--surface); border-radius: 20px; padding: 36px 28px;
  width: 100%; max-width: 380px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.auth-logo { font-size: 52px; }
.auth-card h1 { font-size: 26px; margin: 4px 0 6px; }
.auth-tagline { color: var(--text-sub); font-size: 13px; margin-bottom: 22px; }
.auth-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); outline: none;
}
.auth-card input:focus { border-color: var(--brand); }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.btn {
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 15px; font-weight: 600;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-link { background: none; border: none; color: var(--brand); margin-top: 14px; font-size: 14px; }

/* ===== レイアウト ===== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.app-title { font-weight: 700; font-size: 17px; }
.icon-btn { background: none; border: none; font-size: 20px; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: var(--text-sub); font-size: 10px; position: relative;
}
.nav-item.active { color: var(--brand); }
.nav-icon { font-size: 21px; }
.badge {
  position: absolute; top: 4px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}

.view {
  padding: calc(var(--header-h) + 10px) 0 calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  max-width: 620px; margin: 0 auto; min-height: 100dvh;
}

@media (min-width: 900px) {
  .nav {
    top: var(--header-h); bottom: auto; left: 0; right: auto; width: 210px; height: calc(100dvh - var(--header-h));
    flex-direction: column; justify-content: flex-start; border-top: none; border-right: 1px solid var(--border);
    padding: 14px 10px;
  }
  .nav-item {
    flex: none; flex-direction: row; gap: 12px; padding: 11px 14px; border-radius: 12px;
    font-size: 15px; margin-bottom: 2px;
  }
  .nav-item:hover { background: var(--surface-2); }
  .nav-item.active { background: var(--brand-soft); }
  .badge { position: static; margin-left: auto; }
  .view { padding-left: 12px; padding-right: 12px; margin-left: max(210px, calc(50% - 310px)); }
}

/* ===== 共通部品 ===== */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
  position: relative;
}
.avatar.sm { width: 34px; height: 34px; font-size: 17px; }
.avatar.lg { width: 72px; height: 72px; font-size: 38px; }
.avatar .online-dot {
  position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--surface);
}
.avatar.anon { background: repeating-linear-gradient(45deg, #575c6b, #575c6b 6px, #464b59 6px, #464b59 12px) !important; }

.card {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  margin: 0 10px 10px; padding: 14px;
}
.section-title { font-size: 13px; font-weight: 700; color: var(--text-sub); margin: 16px 14px 8px; }
.empty-note { text-align: center; color: var(--text-sub); padding: 40px 20px; font-size: 14px; }
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px;
  vertical-align: 1px;
}
.chip.anon-chip { background: var(--accent-anon); color: #fff; }
.chip.me-chip { background: var(--brand-soft); color: var(--brand); }

/* ===== タイムライン ===== */
.feed-tabs { display: flex; margin: 0 10px 10px; background: var(--surface); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); }
.feed-tab {
  flex: 1; border: none; background: none; padding: 8px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-sub);
}
.feed-tab.active { background: var(--brand); color: #fff; }

.compose { display: flex; gap: 10px; }
.compose textarea {
  flex: 1; border: none; background: none; resize: none; outline: none; min-height: 44px; padding-top: 8px;
}
.compose-footer { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-left: 52px; }
.compose-count { font-size: 12px; color: var(--text-sub); margin-left: auto; }
.compose-count.over { color: var(--danger); font-weight: 700; }

.anon-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; user-select: none; }
.anon-switch .track {
  width: 40px; height: 22px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border);
  position: relative; transition: background .15s;
}
.anon-switch .knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.anon-switch input { display: none; }
.anon-switch input:checked + .track { background: var(--accent-anon); border-color: var(--accent-anon); }
.anon-switch input:checked + .track .knob { left: 20px; }
.anon-switch.on { color: var(--accent-anon); font-weight: 700; }

.post { display: flex; gap: 10px; cursor: pointer; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.post-name { font-weight: 700; font-size: 14.5px; }
.post-sub { color: var(--text-sub); font-size: 12.5px; }
.post-time { color: var(--text-sub); font-size: 12px; margin-left: auto; }
.post-body { margin-top: 3px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.post-body .tag-link { color: var(--brand); font-weight: 600; }
.post-actions { display: flex; gap: 4px; margin-top: 8px; margin-left: -8px; }
.post-action {
  background: none; border: none; color: var(--text-sub); font-size: 13px;
  display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 8px;
}
.post-action:hover { background: var(--surface-2); }
.post-action.liked { color: #ff5b7f; font-weight: 700; }
.post-action.reposted { color: var(--success); font-weight: 700; }
.repost-note { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; padding-left: 52px; }
.post-embed { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-top: 6px; }
.load-more { display: block; margin: 10px auto 0; }
.new-posts-pill {
  display: block; margin: 0 auto 10px; padding: 7px 18px; border: none; border-radius: 18px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(90, 61, 240, .4);
}

/* ===== トーク一覧 ===== */
.conv-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.conv-item:first-child { border-radius: 14px 14px 0 0; }
.conv-item:last-child { border-radius: 0 0 14px 14px; border-bottom: none; }
.conv-item:only-child { border-radius: 14px; }
.conv-item:hover { background: var(--surface-2); }
.conv-list { margin: 0 10px 10px; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.conv-main { flex: 1; min-width: 0; }
.conv-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.conv-preview { color: var(--text-sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.conv-time { font-size: 11px; color: var(--text-sub); }

/* ===== チャット画面 ===== */
.chat-screen {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg);
}
.chat-header {
  height: var(--header-h); display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chat-header-name { font-weight: 700; font-size: 15.5px; }
.chat-header-status { font-size: 11.5px; color: var(--text-sub); }
.chat-header .grow { flex: 1; min-width: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 12px 6px; }
.msg-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-end; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-col { max-width: 74%; display: flex; flex-direction: column; }
.msg-row.mine .msg-col { align-items: flex-end; }
.msg-sender { font-size: 11.5px; color: var(--text-sub); margin: 0 4px 2px; }
.bubble {
  padding: 9px 13px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word;
  background: var(--bubble-theirs); box-shadow: var(--shadow); position: relative;
}
.msg-row.mine .bubble { background: var(--bubble-mine); color: var(--bubble-mine-text); border-bottom-right-radius: 5px; }
.msg-row:not(.mine) .bubble { border-bottom-left-radius: 5px; }
.bubble.sticker { background: none; box-shadow: none; font-size: 52px; padding: 0; line-height: 1.15; }
.bubble.call-log { background: var(--surface-2); color: var(--text-sub); font-size: 13px; }
.msg-meta { font-size: 10.5px; color: var(--text-sub); flex-shrink: 0; text-align: right; line-height: 1.35; }
.msg-meta .read { color: var(--brand); font-weight: 600; display: block; }
.location-card { min-width: 200px; }
.location-map { border: 0; width: 100%; height: 140px; border-radius: 10px; margin-top: 6px; background: var(--surface-2); }
.location-link { display: inline-block; margin-top: 5px; font-size: 12.5px; font-weight: 600; }
.date-sep { text-align: center; margin: 14px 0 12px; }
.date-sep span { background: var(--surface-2); color: var(--text-sub); font-size: 11.5px; padding: 3px 12px; border-radius: 10px; }
.typing-note { font-size: 12px; color: var(--text-sub); padding: 0 14px 4px; min-height: 20px; }

.chat-input-bar {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0;
}
.chat-input-bar textarea {
  flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 18px;
  padding: 9px 14px; resize: none; outline: none; max-height: 110px; min-height: 38px;
}
.send-btn { background: var(--brand); color: #fff; border: none; border-radius: 50%; width: 38px; height: 38px; font-size: 17px; flex-shrink: 0; }
.send-btn:disabled { opacity: .4; }

.sticker-panel {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px;
  padding: 10px; background: var(--surface); border-top: 1px solid var(--border); max-height: 190px; overflow-y: auto;
}
.sticker-panel button { background: none; border: none; font-size: 33px; padding: 4px; border-radius: 8px; }
.sticker-panel button:hover { background: var(--surface-2); }

/* ===== 通話 ===== */
.incoming-call {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: min(94vw, 400px);
  background: var(--surface); border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.35);
  animation: slide-down .25s ease;
}
@keyframes slide-down { from { transform: translate(-50%, -120%); } to { transform: translate(-50%, 0); } }
.incoming-info { flex: 1; min-width: 0; }
.incoming-name { font-weight: 700; }
.incoming-kind { font-size: 12.5px; color: var(--text-sub); }
.call-btn {
  border: none; border-radius: 50%; width: 46px; height: 46px; font-size: 19px;
  background: var(--surface-2); color: var(--text);
}
.call-btn.accept { background: var(--success); color: #fff; }
.call-btn.decline { background: var(--danger); color: #fff; }
.call-btn.off { background: var(--danger); color: #fff; }

.call-screen {
  position: fixed; inset: 0; z-index: 55; background: #0d0f16; display: flex;
  align-items: center; justify-content: center;
}
#remote-video { width: 100%; height: 100%; object-fit: cover; }
#local-video {
  position: absolute; right: 14px; top: 14px; width: 110px; border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.5); background: #000;
}
.call-avatar-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.call-avatar {
  width: 110px; height: 110px; border-radius: 50%; font-size: 56px;
  display: flex; align-items: center; justify-content: center;
}
.call-peer-name { color: #fff; font-size: 21px; font-weight: 700; }
.call-status { position: absolute; top: 22px; left: 0; right: 0; text-align: center; color: #cfd3e0; font-size: 14px; }
.call-controls { position: absolute; bottom: calc(30px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 22px; }
.call-controls .call-btn { width: 58px; height: 58px; font-size: 23px; background: rgba(255,255,255,.16); color: #fff; }
.call-controls .call-btn.off { background: var(--danger); }
.call-controls .call-btn.decline { background: var(--danger); }

/* ===== 通知 ===== */
.notif-item { display: flex; gap: 12px; align-items: center; padding: 13px 14px; background: var(--surface); border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item.unread { background: var(--brand-soft); }
.notif-item:hover { filter: brightness(.98); }
.notif-text { flex: 1; font-size: 14px; min-width: 0; }
.notif-time { font-size: 11.5px; color: var(--text-sub); }

/* ===== プロフィール ===== */
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0; }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-username { color: var(--text-sub); font-size: 13.5px; }
.profile-bio { font-size: 14px; max-width: 420px; white-space: pre-wrap; }
.profile-counts { display: flex; gap: 22px; margin-top: 4px; }
.profile-counts .c { text-align: center; font-size: 12px; color: var(--text-sub); }
.profile-counts .c b { display: block; font-size: 16px; color: var(--text); }
.profile-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

.friend-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.friend-item .grow { flex: 1; min-width: 0; }
.friend-name { font-weight: 700; font-size: 14.5px; }
.friend-sub { font-size: 12px; color: var(--text-sub); }

/* ===== 検索 ===== */
.search-bar { display: flex; gap: 8px; margin: 0 10px 12px; }
.search-bar input {
  flex: 1; padding: 11px 16px; border-radius: 22px; border: 1px solid var(--border);
  background: var(--surface); outline: none;
}
.search-bar input:focus { border-color: var(--brand); }
.trend-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: var(--surface); border-bottom: 1px solid var(--border); cursor: pointer; }
.trend-item:hover { background: var(--surface-2); }
.trend-tag { font-weight: 700; color: var(--brand); }
.trend-count { font-size: 12px; color: var(--text-sub); }

/* ===== モーダル・トースト ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 20, .5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface); border-radius: 20px 20px 0 0; width: 100%; max-width: 480px;
  max-height: 82dvh; overflow-y: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: rise .2s ease;
}
@keyframes rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; }
}
.modal h3 { margin-bottom: 14px; font-size: 17px; }
.modal .field { margin-bottom: 12px; }
.modal .field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-sub); margin-bottom: 4px; }
.modal .field input, .modal .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); outline: none;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.member-pick { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; border-radius: 10px; }
.member-pick:hover { background: var(--surface-2); }
.member-pick input { width: 18px; height: 18px; accent-color: var(--brand); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.emoji-grid button { font-size: 26px; background: none; border: 2px solid transparent; border-radius: 10px; padding: 4px; }
.emoji-grid button.sel { border-color: var(--brand); background: var(--brand-soft); }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.color-row button.sel { border-color: var(--text); }

#toast-root { position: fixed; bottom: calc(var(--nav-h) + 18px); left: 0; right: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(20, 23, 34, .92); color: #fff; padding: 10px 20px; border-radius: 22px;
  font-size: 13.5px; animation: rise .2s ease; max-width: 88vw;
}
[data-theme="dark"] .toast { background: rgba(240, 242, 250, .95); color: #14161f; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 54px; height: 54px; border-radius: 50%; border: none; background: var(--brand); color: #fff;
  font-size: 23px; box-shadow: 0 6px 18px rgba(90, 61, 240, .45);
}
@media (min-width: 900px) { .fab { right: calc(50% - 330px); } }

/* ===== 画像 ===== */
.post-image {
  display: block; margin-top: 8px; max-width: 100%; max-height: 420px;
  border-radius: 12px; border: 1px solid var(--border); object-fit: cover; cursor: pointer;
}
.img-preview { padding-left: 52px; margin-top: 6px; }
.img-preview-wrap { position: relative; display: inline-block; }
.img-preview-wrap img { max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.img-remove {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: var(--danger); color: #fff; font-size: 12px; line-height: 1;
}
.bubble.image-bubble { padding: 4px; background: none; box-shadow: none; }
.chat-image { max-width: 220px; max-height: 300px; border-radius: 12px; display: block; cursor: pointer; box-shadow: var(--shadow); }
.post-action.bookmarked { color: var(--brand); font-weight: 700; }

/* ===== リアクション ===== */
.bubble-line { display: flex; align-items: flex-end; gap: 4px; }
.msg-row.mine .bubble-line { flex-direction: row-reverse; }
.react-add {
  border: none; background: var(--surface-2); color: var(--text-sub); width: 22px; height: 22px;
  border-radius: 50%; font-size: 12px; opacity: 0; transition: opacity .15s; flex-shrink: 0; align-self: center;
}
.msg-row:hover .react-add { opacity: .85; }
@media (hover: none) { .react-add { opacity: .6; } }
.reactions-slot { display: flex; flex-wrap: wrap; gap: 4px; }
.msg-row.mine .reactions-slot { justify-content: flex-end; }
.reactions-slot:not(:empty) { margin-top: 4px; }
.reaction-chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 1px 8px;
  font-size: 12px; color: var(--text); line-height: 1.5;
}
.reaction-chip.mine { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.reaction-picker {
  position: fixed; z-index: 65; display: flex; gap: 2px; padding: 6px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.reaction-picker button { border: none; background: none; font-size: 22px; padding: 2px 4px; border-radius: 8px; }
.reaction-picker button:hover { background: var(--surface-2); }

/* ===== グループ通話 ===== */
.gcall-screen {
  /* 1:1通話画面 (z-index:55) より下に置く。両方が同時に出ることは無い想定だが、
     万一重なっても 1:1 側の操作ボタンが押せなくならないようにしておく。 */
  position: fixed; inset: 0; z-index: 54; background: #0d0f16; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 0;
}
.gcall-tile audio { display: none; }
.gcall-title { color: #eef0f6; text-align: center; padding: 14px; font-weight: 700; font-size: 15px; }
.gcall-grid {
  flex: 1; display: grid; gap: 6px; padding: 6px; overflow-y: auto;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-content: center;
}
.gcall-tile {
  position: relative; background: #1a1d28; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; min-height: 150px;
}
.gcall-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.gcall-tile-avatar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gcall-tile-name {
  position: absolute; bottom: 6px; left: 6px; right: 6px; color: #fff; font-size: 12px; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 送信取り消し・編集・ミュート送信 ===== */
.bubble.unsent {
  background: none; border: 1px dashed var(--border); color: var(--text-sub);
  font-size: 13.5px; font-style: italic; box-shadow: none;
}
.msg-row.mine .bubble.unsent { background: none; color: var(--text-sub); }
.edited-mark { display: block; font-size: 10px; color: var(--text-sub); }
.msg-menu-btn { font-size: 14px; }
.msg-menu {
  position: fixed; z-index: 65; display: flex; flex-direction: column; min-width: 150px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); overflow: hidden; padding: 4px;
}
.msg-menu button {
  border: none; background: none; color: var(--text); text-align: left;
  padding: 10px 12px; font-size: 14px; border-radius: 8px;
}
.msg-menu button:hover { background: var(--surface-2); }
.msg-menu button.danger { color: var(--danger); }
.icon-btn.active { background: var(--brand-soft); }

/* ===== リカバリーコード ===== */
.recovery-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px; font-weight: 700; letter-spacing: 1px; text-align: center;
  background: var(--surface-2); border: 1px dashed var(--brand); border-radius: 10px;
  padding: 14px 10px; margin: 12px 0; word-break: break-all; user-select: all;
}
.recovery-warn {
  background: #fff4e5; color: #8a5300; border-radius: 10px; padding: 10px 12px; font-size: 13px;
}
[data-theme="dark"] .recovery-warn { background: #3a2c14; color: #f0c987; }
