:root {
  --bg-app: #1e1f22;
  --bg-sidebar: #2b2d31;
  --bg-main: #313338;
  --bg-card: #2b2d31;
  --bg-input: #383a40;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #f2f3f5;
  --text-secondary: #949ba4;
  --text-muted: #80848e;
  --border-color: #3f4147;
  --accent-color: #5865f2;
  --accent-hover: #4752c4;
  --danger-color: #da373c;
  --danger-hover: #a1282c;
  --success-color: #23a55a;
  --idle-color: #f0b232;
  --dnd-color: #f23f43;
  --offline-color: #80848e;
  --mention-bg: rgba(250, 166, 26, 0.15);
  --mention-border: #faa61a;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

[data-theme="light"] {
  --bg-app: #e3e5e8;
  --bg-sidebar: #f2f3f5;
  --bg-main: #ffffff;
  --bg-card: #e3e5e8;
  --bg-input: #ebedef;
  --bg-hover: rgba(0, 0, 0, 0.05);
  --text-primary: #060607;
  --text-secondary: #4e5058;
  --text-muted: #5c5e66;
  --border-color: #d1d3d7;
  --accent-color: #5865f2;
  --accent-hover: #4752c4;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-xs { width: 12px; height: 12px; }
.icon-lg { width: 28px; height: 28px; }

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* 1. 左サイドバー */
.sidebar-channels {
  width: 240px;
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
}

.workspace-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.workspace-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.workspace-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.room-pill {
  font-size: 10px;
  background: var(--border-color);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 10px;
}

.header-btns {
  display: flex;
  gap: 4px;
}

.icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn-sm:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.icon-btn-sm.danger:hover { color: var(--danger-color); }

.channels-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.channel-group {
  margin-bottom: 16px;
}

.group-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.add-channel-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.add-channel-btn:hover { color: var(--text-primary); }

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s;
}
.channel-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.channel-item.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
}

.ch-main-line {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-prefix {
  font-size: 16px;
  color: var(--text-muted);
}

.del-ch-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 2px;
}
.channel-item:hover .del-ch-btn {
  display: flex;
}
.del-ch-btn:hover {
  color: var(--danger-color);
}

.voice-members {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 24px;
  margin-top: 4px;
}

.voice-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-user-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ボイス接続中パネル */
.voice-connected-panel {
  background-color: #111214;
  border-top: 1px solid var(--border-color);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-conn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  box-shadow: 0 0 6px var(--success-color);
}

.conn-text { display: flex; flex-direction: column; }
.conn-label { font-size: 11px; font-weight: 700; color: var(--success-color); }
.conn-room { font-size: 12px; color: var(--text-secondary); }

.disconnect-btn {
  background: transparent;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.disconnect-btn:hover { background: rgba(218, 55, 60, 0.15); }

.voice-conn-controls { display: flex; gap: 4px; }
.v-btn {
  flex: 1;
  height: 32px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.v-btn.active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.v-btn.danger { background: var(--danger-color); color: #fff; border-color: var(--danger-color); }

/* ユーザーフッター */
.sidebar-user-footer {
  height: 52px;
  background-color: var(--bg-app);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.user-avatar-wrapper {
  position: relative;
  cursor: pointer;
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.user-status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}
.user-status-indicator.online { background-color: var(--success-color); }
.user-status-indicator.idle { background-color: var(--idle-color); }
.user-status-indicator.dnd { background-color: var(--dnd-color); }
.user-status-indicator.offline { background-color: var(--offline-color); }

.user-name-box { flex: 1; overflow: hidden; }
.u-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-status { font-size: 11px; color: var(--text-muted); }

/* 2. メインエリア */
.main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.main-topbar {
  height: 48px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 8px; }
.channel-hash { font-size: 18px; color: var(--text-muted); }
.channel-title-text { font-size: 15px; font-weight: 700; }
.channel-topic { font-size: 12px; color: var(--text-muted); border-left: 1px solid var(--border-color); padding-left: 10px; margin-left: 4px; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.search-box-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}
.search-box-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  width: 120px;
  transition: width 0.2s;
}
.search-box-wrapper input:focus { width: 180px; }

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-flow {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-notice {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.msg-row {
  display: flex;
  gap: 12px;
  position: relative;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.msg-row:hover { background-color: var(--bg-hover); }
.msg-row.mentioned {
  background-color: var(--mention-bg);
  border-left: 2px solid var(--mention-border);
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.msg-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reply-reference-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.reply-reference-line::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 8px;
  border-left: 2px solid var(--border-color);
  border-top: 2px solid var(--border-color);
  border-top-left-radius: 4px;
}

.msg-header-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.msg-author { font-size: 14px; font-weight: 600; }
.msg-time { font-size: 11px; color: var(--text-muted); }
.msg-pinned-badge { font-size: 10px; color: var(--idle-color); }
.msg-edited-badge { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

.msg-body {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}
.msg-body strong { font-weight: 700; }
.msg-body em { font-style: italic; }
.msg-body del { text-decoration: line-through; opacity: 0.6; }
.msg-body code {
  background: #1e1f22;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 13px;
}
.msg-body pre {
  background: #1e1f22;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  overflow-x: auto;
}

.mention-tag {
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.msg-image {
  max-width: 400px;
  max-height: 280px;
  border-radius: var(--radius-md);
  margin-top: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.msg-file-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  margin-top: 6px;
  font-size: 13px;
}

.reactions-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}
.reaction-pill:hover { background: var(--bg-hover); }
.reaction-pill.reacted { border-color: var(--accent-color); background: rgba(88, 101, 242, 0.15); }

/* ホバー時のクイックアクション */
.msg-actions-overlay {
  position: absolute;
  top: -12px;
  right: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: none;
  gap: 2px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.msg-row:hover .msg-actions-overlay { display: flex; }

.action-btn-mini {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-btn-mini:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-btn-mini.danger:hover { color: var(--danger-color); }

/* インライン編集ボックス */
.inline-edit-box {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inline-edit-box textarea {
  background: var(--bg-input);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px;
  outline: none;
  resize: none;
}
.edit-actions {
  font-size: 11px;
  color: var(--text-muted);
}
.edit-actions a {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: underline;
}

/* 入力中インジケーター */
.typing-indicator-bar {
  height: 20px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.typing-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.composer-container {
  padding: 0 16px 20px;
  position: relative;
}

/* GIF ボタン */
.gif-button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.gif-button:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

/* GIF ピッカーポップオーバー */
.gif-picker-popover {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 360px;
  height: 380px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gif-picker-header {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}
.gif-picker-header input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
}
.gif-picker-header input:focus {
  border-color: var(--accent-color);
}

.gif-categories {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.gif-cat-tag {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.gif-cat-tag:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.gif-cat-tag.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.gif-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gif-card-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-app);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.gif-card-item:hover {
  transform: scale(1.02);
  border-color: var(--accent-color);
  z-index: 2;
}
.gif-card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reply-banner {
  background: var(--bg-card);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-bottom: none;
}
.reply-to-user { font-weight: 600; color: var(--accent-color); }
.cancel-reply-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; }

.composer-box {
  background-color: var(--bg-input);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 8px;
}
.reply-banner + .composer-box {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.attach-button {
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
}
.attach-button:hover { color: var(--text-primary); }

.composer-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  resize: none;
  padding: 8px 0;
  max-height: 120px;
}

.send-message-btn {
  background: transparent;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 3. 通話専用ステージビュー */
.voice-stage-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #111214;
  overflow: hidden;
}

.stage-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.stage-room-info { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.stage-users-count { font-size: 12px; font-weight: normal; color: var(--text-muted); }

.stage-screen-focus {
  flex: 2;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 65vh;
}
.stage-screen-focus video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.screen-tag-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #fff;
}

.stage-tiles-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  align-content: center;
}

.tile-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #232428;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}
.tile-box.speaking { border-color: var(--success-color); }
.tile-box video { width: 100%; height: 100%; object-fit: cover; }
.tile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}
.tile-foot {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #fff;
}

/* 4. 右サイドバー (メンバー一覧) */
.sidebar-members {
  width: 220px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.members-title {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.member-count-badge {
  background: var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
}

.members-list-flow {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}
.m-row:hover { background: var(--bg-hover); color: var(--text-primary); }

.m-avatar-box {
  position: relative;
}
.m-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.m-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--bg-sidebar);
}
.m-status-dot.online { background: var(--success-color); }
.m-status-dot.idle { background: var(--idle-color); }
.m-status-dot.dnd { background: var(--dnd-color); }
.m-status-dot.offline { background: var(--offline-color); }

/* 5. ピン留めメッセージドロワー */
.pinned-drawer {
  position: absolute;
  top: 48px;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 12px rgba(0,0,0,0.25);
}

.pinned-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 14px;
}

.pinned-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pinned-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 40px;
}

.pinned-card {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
}
.pinned-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* 6. ステータスポップオーバー */
.status-popover {
  position: absolute;
  bottom: 60px;
  left: 12px;
  width: 220px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  z-index: 1000;
}
.status-options { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.status-option:hover { background: var(--bg-hover); }
.status-dot-mini {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-mini.online { background: var(--success-color); }
.status-dot-mini.idle { background: var(--idle-color); }
.status-dot-mini.dnd { background: var(--dnd-color); }
.status-dot-mini.offline { background: var(--offline-color); }
.opt-name { font-size: 12px; font-weight: 600; }
.opt-desc { font-size: 10px; color: var(--text-muted); }

/* モーダル */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-box {
  background: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 440px;
  border: 1px solid var(--border-color);
}
.modal-header-simple h2, .modal-header-simple h3 { font-size: 18px; }
.modal-header-simple p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.field-group { margin-bottom: 14px; }
.field-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.text-field {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.text-field:focus { border-color: var(--accent-color); }
.input-with-action { display: flex; gap: 8px; }

.btn-primary-block {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-subtle {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}
.btn-subtle:hover { background: var(--bg-hover); color: var(--text-primary); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.cloak-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cloak-tile {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.cloak-tile:hover { background: var(--bg-card); }
.cloak-tile.selected { border-color: var(--accent-color); background: var(--bg-card); }
.cloak-name { font-size: 13px; font-weight: 600; }
.cloak-desc { font-size: 11px; color: var(--text-muted); }

.stealth-layer {
  position: fixed;
  inset: 0;
  background: #ffffff;
  color: #202122;
  z-index: 99999;
  display: none;
  overflow-y: auto;
}
.stealth-layer.active { display: block; }
.stealth-bar {
  border-bottom: 1px solid #a2a9b1;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
}
.stealth-doc { max-width: 860px; margin: 30px auto; padding: 0 20px; }

.preview-container { position: relative; max-width: 90vw; max-height: 90vh; }
.preview-container img { max-width: 100%; max-height: 85vh; object-fit: contain; }
.close-preview-btn { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: #fff; }
