:root {
  --ed-bg: #ffffff;
  --ed-surface: #ffffff;
  --ed-border: #e3e3e8;
  --ed-text: #111111;
  --ed-muted: #5c5c66;
  --ed-accent: #0b57d0;
  --ed-accent-soft: #e8f0fe;
  --ed-radius: 8px;
  --ed-gap: 0;
  --ed-font: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --ed-preview-scale: 1;
  --ed-header-h: 72px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--ed-font);
  color: var(--ed-text);
  background: var(--ed-bg);
  line-height: 1.5;
}

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

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ed-border);
  background: var(--ed-surface);
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.app-header .sub {
  margin: 4px 0 0;
  color: var(--ed-muted);
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  max-width: none;
  margin: 0;
  min-height: 0;
}

.panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 20px;
}

.panel-sidebar {
  display: flex;
  flex-direction: column;
  position: static;
  top: auto;
  max-height: none;
  height: auto;
  overflow: visible;
  padding: 16px 16px 0;
  border-right: none;
  border-bottom: 1px solid var(--ed-border);
  background: var(--ed-surface);
  z-index: auto;
}

.panel-preview {
  padding: 16px 24px 24px;
  min-width: 0;
  position: relative;
  z-index: 0;
  background: var(--ed-surface);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.style-block {
  flex-shrink: 0;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ed-border);
}

.style-block h2 {
  margin-bottom: 8px;
}

.style-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--ed-muted);
}

.style-hint:not([hidden]):empty {
  display: none;
}

.scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.scope-tab {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--ed-muted);
  padding: 6px 10px;
  font-size: 0.9rem;
}

.scope-tab.is-active {
  background: var(--ed-accent-soft);
  color: var(--ed-accent);
  font-weight: 600;
}

.scope-note-line {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--ed-muted);
  line-height: 1.4;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.controls-scroll {
  flex: none;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 2px;
  margin-bottom: 0;
}

/* 本物のデスクトップポインタ環境だけ sticky（タッチ幅では絶対に使わない） */
@media (min-width: 861px) and (hover: hover) and (pointer: fine) {
  .layout {
    grid-template-columns: minmax(300px, 360px) 1fr;
    align-items: start;
    min-height: calc(100vh - var(--ed-header-h));
  }

  .panel-sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow: hidden;
    border-right: 1px solid var(--ed-border);
    border-bottom: none;
    z-index: 2;
  }

  .controls-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
  }

  .panel-preview {
    z-index: 0;
  }
}

/* 狭い画面は sticky を強制オフ（キャッシュや古い規則の残り対策） */
@media (max-width: 860px) {
  .panel-sidebar {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    z-index: auto !important;
  }

  .controls-scroll {
    flex: none !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .sidebar-footer {
    position: static !important;
  }

  .panel-preview,
  .preview-wrap,
  .preview-stage {
    position: relative;
    z-index: 0;
  }
}

/* 折りたたみは枠なし。区切り線のみ */
.control-details {
  border: none;
  border-bottom: 1px solid var(--ed-border);
  border-radius: 0;
  background: transparent;
}

.control-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ed-text);
  padding: 12px 4px;
  user-select: none;
}

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

.control-details > summary::before {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-right: 8px;
  border-right: 1.5px solid var(--ed-muted);
  border-bottom: 1.5px solid var(--ed-muted);
  transform: rotate(-45deg);
  vertical-align: 0.12em;
  transition: transform 0.15s ease;
}

.control-details[open] > summary::before {
  transform: rotate(45deg);
  vertical-align: 0.02em;
}

.control-details-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 4px 14px;
}

.control-details--scope {
  background: transparent;
  border-bottom: 1px solid var(--ed-border);
}

.control-details--scope > summary {
  font-size: 0.95rem;
}

.control-details--scope > .control-details-body {
  gap: 0;
  padding-left: 12px;
  border-left: 2px solid var(--ed-border);
  margin: 0 0 8px 6px;
}

.control-details--scope .control-details {
  border-bottom-color: #ececf0;
}

.control-group {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--ed-border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ed-muted);
  letter-spacing: 0.02em;
}

.control-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control label.main {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.control .hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--ed-muted);
}

.control .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control input[type="range"] { flex: 1; }
.control input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--ed-border);
  border-radius: 6px;
  background: transparent;
}
.control select,
.control input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ed-border);
  border-radius: 6px;
  font: inherit;
}

.control .val {
  min-width: 3.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ed-muted);
  font-size: 0.85rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.sidebar-footer {
  flex-shrink: 0;
  margin: 0 -16px 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--ed-border);
  background: var(--ed-surface);
  box-shadow: none;
}

.preset-panel {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.preset-row + .preset-row {
  margin-top: 8px;
}

.preset-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.preset-select {
  flex: 1;
  min-width: 8rem;
  padding: 8px 10px;
  border: 1px solid var(--ed-border);
  border-radius: 6px;
  font: inherit;
  background: var(--ed-surface);
}

.preset-manage {
  margin-top: 8px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.preset-manage > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ed-muted);
  padding: 6px 0;
}

.preset-manage > summary::-webkit-details-marker { display: none; }

.preset-manage-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 8px;
}

.preset-manage-body button {
  font-size: 0.8rem;
  padding: 6px 8px;
}

button.primary-soft {
  background: var(--ed-accent-soft);
  border-color: var(--ed-accent);
  color: var(--ed-accent);
  font-weight: 600;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--ed-border);
  background: var(--ed-surface);
  color: var(--ed-text);
  padding: 8px 12px;
}

.hint.is-err,
#preset-status.is-err {
  color: #b42318;
}

button.primary {
  background: var(--ed-accent);
  border-color: var(--ed-accent);
  color: #fff;
  font-weight: 600;
}

button:hover { filter: brightness(0.97); }
button.primary:hover { filter: brightness(1.05); }

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ed-muted);
}

.note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--ed-muted);
}

.panel-preview .preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.panel-preview .preview-head h2 {
  margin: 0;
}

.preview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 0;
}

.preview-tool-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.segment {
  display: inline-flex;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ed-bg);
}

.segment-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--ed-muted);
  cursor: pointer;
  border-right: 1px solid var(--ed-border);
  user-select: none;
}

.segment-item:last-child {
  border-right: none;
}

.segment-item:has(input:checked) {
  background: var(--ed-accent-soft);
  color: var(--ed-accent);
  font-weight: 600;
}

.segment-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preview-menu {
  position: relative;
}

.preview-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  background: var(--ed-bg);
  font-size: 0.85rem;
  color: var(--ed-text);
  user-select: none;
}

.preview-menu > summary::-webkit-details-marker { display: none; }

.preview-menu-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ed-accent);
  background: var(--ed-accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.78rem;
}

.preview-menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  background: var(--ed-surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.css-snippet {
  margin-top: 12px;
  border: none;
  border-top: 1px solid var(--ed-border);
  border-radius: 0;
  padding: 10px 0 0;
  background: transparent;
}

.css-snippet summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ed-muted);
}

.css-snippet-out {
  margin: 10px 0 4px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 6px;
  background: #1e1e22;
  color: #e8e8ec;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.preview-wrap {
  overflow: auto;
  min-height: 420px;
  border-radius: 0;
  border: 1px solid #2a2a2e;
  padding: 20px;
  background:
    linear-gradient(45deg, #2a2a2e 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a2e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a2e 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a2e 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #1a1a1e;
}

/* PC 既定: フレームなし */
.phone-bezel { display: contents; }
.phone-notch,
.yt-app-bar,
.yt-meta { display: none; }
.yt-fake-video { display: none; }
.yt-player-inner { position: relative; }

.preview-stage {
  --ed-preview-scale: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: max-content;
  max-width: 100%;
}

.preview-block[hidden],
.chat-preview[hidden],
.discord-preview[hidden],
.chat-item[hidden] {
  display: none !important;
}

.preview-block-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #c8c8d0;
  letter-spacing: 0.02em;
}

/* スマホ: 実機 CSS 論理解像度に近い枠 + YouTube 風（映像は常に 16:9）
   縦 390×844 / 横 844×390（iPhone 14 系）。オーバーレイ縮尺 = 映像幅 / 1920 */
#preview-shell[data-mode^="phone"] {
  --phone-w: 390;
  --phone-h: 844;
  /* 端末外のステージ。黒だと境界が分かりにくいので薄いグレー */
  background: #eef0f3;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

#preview-shell[data-mode="phone-landscape"] {
  --phone-w: 844;
  --phone-h: 390;
}

#preview-shell[data-mode^="phone"] .phone-bezel {
  display: flex;
  flex-direction: column;
  width: min(calc(var(--phone-w) * 1px), 100%);
  aspect-ratio: var(--phone-w) / var(--phone-h);
  height: auto;
  background: #111;
  border: 3px solid #2a2a2a;
  border-radius: 36px;
  padding: 11px 10px 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

#preview-shell[data-mode="phone-landscape"] .phone-bezel {
  border-radius: 28px;
  padding: 10px 14px;
}

#preview-shell[data-mode="phone-portrait"] .phone-notch {
  display: block;
  flex-shrink: 0;
  width: 108px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 999px;
  background: #000;
}

#preview-shell[data-mode^="phone"] .yt-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0f0f0f;
  color: #f1f1f1;
  border-radius: 28px;
  overflow: hidden;
}

#preview-shell[data-mode="phone-landscape"] .yt-app {
  border-radius: 14px;
  background: #000;
}

#preview-shell[data-mode^="phone"] .yt-app-bar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
}

#preview-shell[data-mode="phone-landscape"] .yt-app-bar {
  display: none;
}

.yt-bar-btn { opacity: 0.85; }
.yt-live-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #cc0000;
  color: #fff;
  border-radius: 3px;
  padding: 2px 6px;
}
.yt-bar-spacer { flex: 1; }

#preview-shell[data-mode^="phone"] .yt-player {
  flex-shrink: 0;
  background: #000;
}

/* 縦: 画面幅いっぱいの 16:9（YouTube アプリと同じ） */
#preview-shell[data-mode="phone-portrait"] .yt-player-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a1a;
}

/* 横: 画面内に 16:9 を contain（左右に黒帯が出るのが正しい） */
#preview-shell[data-mode="phone-landscape"] .yt-player {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
}

/* フォールバック（container query 非対応） */
#preview-shell[data-mode="phone-landscape"] .yt-player-inner {
  position: relative;
  height: 100%;
  width: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  background: #1a1a1a;
}

@supports (width: 1cqw) {
  #preview-shell[data-mode="phone-landscape"] .yt-player-inner {
    height: auto;
    width: min(100cqw, calc(100cqh * 16 / 9));
    max-width: none;
  }
}

#preview-shell[data-mode^="phone"] .yt-fake-video {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, #2a3344 0%, transparent 55%),
    linear-gradient(160deg, #1b1f2a, #0e1016 70%);
}

#preview-shell[data-mode^="phone"] .yt-fake-caption {
  display: inline-block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
}

/* 1920×1080 論理キャンバスを映像枠にフィット（縮尺は JS が実測で更新） */
#preview-shell[data-mode^="phone"] .preview-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  max-width: none;
  gap: 0;
  --overlay-scale: 0.2;
  transform: scale(var(--overlay-scale));
  transform-origin: top left;
  pointer-events: none;
}

#preview-shell[data-mode^="phone"] .preview-stage .dc-card {
  pointer-events: auto;
}

#preview-shell[data-mode^="phone"] .preview-block-label {
  display: none;
}

/* Suite 統合 OBS レイアウト既定（settings-suite SUITE_LAYOUT_DEFAULTS）に合わせる */
#preview-shell[data-mode^="phone"] #chat-preview-wrap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 400px; /* youtube-overlay --width 既定（レイヤー枠は 440） */
}

#preview-shell[data-mode^="phone"] #discord-preview-wrap {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 340px;
}

#preview-shell[data-mode^="phone"] .yt-meta {
  display: block;
  flex: 1;
  min-height: 0;
  padding: 10px 12px 14px;
  background: #0f0f0f;
}

#preview-shell[data-mode="phone-landscape"] .yt-meta {
  display: none;
}

.yt-meta-title {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.yt-meta-sub {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #aaa;
}

/* Chat mock — mirrors youtube-overlay.html */
.chat-preview {
  --font-family: 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --font-size: 14px;
  --bg-color: rgba(0, 0, 0, 0.75);
  --text-color: #f0f0f0;
  --username-color: #7dd3fc;
  --superchat-color: #fbbf24;
  --owner-color: #f87171;
  --moderator-color: #86efac;
  --member-color: #818cf8;
  --first-color: #10b981;
  --regular-color: #f59e0b;
  --badge-font-size: 0.65em;
  --badge-padding: 1px 5px;
  --badge-radius: 4px;
  --badge-text-dark: #1a1a1a;
  --badge-text-light: #ffffff;
  --border-radius: 8px;
  --padding: 6px 10px;
  --avatar-size: 22px;
  --gap: 6px;
  --width: 400px;

  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: var(--width);
  font-family: var(--font-family);
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: var(--padding);
  background: var(--bg-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--font-size);
  color: var(--text-color);
  word-break: break-word;
  line-height: 1.4;
}

.chat-item.superchat {
  position: relative;
  background: color-mix(in srgb, var(--superchat-color) 18%, transparent);
  box-shadow: none;
}

.chat-item.superchat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--superchat-color);
  pointer-events: none;
}

/* 本体 youtube-overlay .avatar に合わせる（img 自体が --avatar-size） */
.chat-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  min-height: var(--avatar-size);
  max-width: var(--avatar-size);
  max-height: var(--avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: #555;
  display: block;
}

.chat-avatar--initial {
  display: grid;
  place-items: center;
  font-size: 0.7em;
  font-weight: 700;
  color: #fff;
  background: #555;
}

.chat-body { flex: 1; min-width: 0; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.chat-name {
  font-weight: 700;
  font-size: 0.85em;
  color: var(--username-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--badge-font-size);
  font-weight: 700;
  padding: var(--badge-padding);
  border-radius: var(--badge-radius);
  flex-shrink: 0;
}
.badge-icon {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  flex-shrink: 0;
}
.badge-label { line-height: 1.2; }
.badge-owner { background: var(--owner-color); color: var(--badge-text-dark); }
.badge-moderator { background: var(--moderator-color); color: var(--badge-text-dark); }
.badge-member { background: var(--member-color); color: var(--badge-text-dark); }
.badge-first { background: var(--first-color); color: var(--badge-text-light); }
.badge-regular { background: var(--regular-color); color: var(--badge-text-dark); }

.chat-text {
  font-size: var(--font-size);
  color: var(--text-color);
  word-break: break-word;
}

.superchat-amount {
  margin-top: 3px;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--superchat-color);
}

/* Discord VC mock — mirrors discord-overlay.css */
.discord-preview {
  --speaking-color: #23a55a;
  --speaking-glow: rgba(35, 165, 90, 0.35);
  --overlay-bg: rgba(18, 18, 24, 0.85);
  --text-normal: rgba(255, 255, 255, 0.75);
  --text-speaking: #ffffff;
  --name-bg: rgba(0, 0, 0, 0.45);
  --name-bg-speaking: rgba(35, 165, 90, 0.25);
  --avatar-size: 40px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --list-gap: 4px;
  --name-radius: 6px;
  --name-font-size: 14px;
  width: min(100%, 340px);
}

.dc-user-list {
  display: flex;
  flex-direction: column;
  gap: var(--list-gap);
  padding: 4px;
}

.dc-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  background: var(--overlay-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.dc-card:focus-visible {
  outline: 2px solid var(--ed-accent);
  outline-offset: 2px;
}

.dc-card.speaking {
  border-color: var(--speaking-color);
}

/* 本体 discord-overlay.css .avatar に合わせる */
.dc-avatar {
  box-sizing: border-box;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  min-height: var(--avatar-size);
  max-width: var(--avatar-size);
  max-height: var(--avatar-size);
  border-radius: 50%;
  border: 2px solid transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(88, 101, 242, 0.3);
  font-family: var(--font);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dc-avatar img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.dc-card.speaking .dc-avatar {
  border-color: var(--speaking-color);
  box-shadow: 0 0 0 2px var(--speaking-glow);
  transform: scale(1.06);
}

.dc-name {
  font-family: var(--font);
  font-size: var(--name-font-size);
  font-weight: 600;
  color: var(--text-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--name-bg);
  padding: 2px 8px;
  border-radius: var(--name-radius);
  transition: color 0.15s ease, background 0.15s ease;
}

.dc-card.speaking .dc-name {
  color: var(--text-speaking);
  background: var(--name-bg-speaking);
}

.app-footer {
  max-width: none;
  margin: 0;
  padding: 10px 24px 20px;
  border-top: 1px solid var(--ed-border);
  font-size: 0.85rem;
  color: var(--ed-muted);
}
