:root {
  --bg: #ffffff;
  --sk-strong: #c4c4c4;
  --sk-base: #e2e2e2;
  --sk-light: #efefef;
  --sk-link: #c9d3dc;
  --line: #eff3f4;
  --media-border: #cfd9de;
  --panel: #f7f9f9;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --nav-icon: #b5b5b5;
  --nav-icon-active: #0f1419;
  --icon: #9a9a9a;
  --icon-active: #555555;
  --silhouette: #c4c4c4;
  --media-bg: #ededed;
  --media-icon: #cccccc;
  --accent: #1d9bf0;
  --follow-btn: #0f1419;
  --follow-bar: #ffffff;
  --menu-shadow: 0 0 15px rgba(101, 119, 134, 0.25);
  --text: #0f1419;
  --text-sub: #536471;
  --nav-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --sk-strong: #4a4a4a;
    --sk-base: #2a2a2a;
    --sk-light: #1f1f1f;
    --sk-link: #2e3a44;
    --line: #2f3336;
    --media-border: #2f3336;
    --panel: #16181c;
    --nav-bg: rgba(0, 0, 0, 0.88);
    --nav-icon: #555555;
    --nav-icon-active: #e7e9ea;
    --icon: #6a6a6a;
    --icon-active: #a0a0a0;
    --silhouette: #4a4a4a;
    --media-bg: #161616;
    --media-icon: #333333;
    --follow-btn: #eff3f4;
    --follow-bar: #0f1419;
    --menu-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    --text: #e7e9ea;
    --text-sub: #71767b;
  }
}

/* 手動ダークモード (設定でON/OFF、システム設定に関係なく常時適用) */
html.dark-mode {
  --bg: #000000;
  --sk-strong: #4a4a4a;
  --sk-base: #2a2a2a;
  --sk-light: #1f1f1f;
  --sk-link: #2e3a44;
  --line: #2f3336;
  --media-border: #2f3336;
  --panel: #16181c;
  --nav-bg: rgba(0, 0, 0, 0.88);
  --nav-icon: #555555;
  --nav-icon-active: #e7e9ea;
  --icon: #6a6a6a;
  --icon-active: #a0a0a0;
  --silhouette: #4a4a4a;
  --media-bg: #161616;
  --media-icon: #333333;
  --follow-btn: #eff3f4;
  --follow-bar: #0f1419;
  --menu-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  --text: #e7e9ea;
  --text-sub: #71767b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  overscroll-behavior: none;
  font-family: system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- プレースホルダー共通 ---------- */
.sk { background: var(--sk-base); }
.sk-strong { background: var(--sk-strong); }
.sk-light { background: var(--sk-light); }
.sk-link { background: var(--sk-link); }
.sk-circle { border-radius: 50%; }
.sk-bar { border-radius: 6px; }
.hidden { display: none !important; }

/* ================= 3カラムレイアウト ================= */
.layout {
  display: flex;
  justify-content: center;
  min-height: 100%;
}

/* ---------- 左カラム: ナビゲーション ---------- */
.col-left {
  width: 275px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 16px;
  z-index: 30;
  background: var(--bg);
}
.lnav-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sk-strong);
  margin: 8px 0 8px 12px;
}
.lnav-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 12px;
  border-radius: 9999px;
  background: none;
  border: none;
  cursor: pointer;
  width: fit-content;
}
.lnav-item:hover { background: var(--sk-light); }
.lnav-item svg {
  width: 25px;
  height: 25px;
  stroke: var(--icon-active);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
  flex-shrink: 0;
}
.lnav-item.is-active svg { opacity: 1; stroke-width: 2.4; }
.lnav-item-label {
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
}
.lnav-item.is-active .lnav-item-label { font-weight: 700; }

.lnav-post {
  margin-top: 14px;
  width: 90%;
  height: 50px;
  border: none;
  border-radius: 9999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.lnav-post:hover { filter: brightness(1.06); }

.lnav-profile {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9999px;
  cursor: pointer;
}
.lnav-profile:hover { background: var(--sk-light); }
.lnav-profile-bars { flex: 1; }
.lnav-profile-name { width: 90px; height: 13px; margin-bottom: 7px; }
.lnav-profile-id { width: 70px; height: 10px; }

/* ---------- 中央カラム: タイムライン ---------- */
.col-center {
  width: 600px;
  max-width: 600px;
  min-width: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* タブヘッダー (すりガラス固定) */
.tl-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.tl-tab {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 53px;
  cursor: pointer;
}
.tl-tab:hover { background: var(--sk-light); }
.tab-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-sub);
}
.tl-tab.is-active .tab-label {
  font-weight: 700;
  color: var(--text);
}
.tl-tab .tab-underline { display: none; }
.tl-tab.is-active .tab-underline { display: block; }
.tab-underline {
  position: absolute;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

/* 投稿フォーム (実際に入力できるメモ帳) */
.composer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.composer-form { flex: 1; min-width: 0; }
.composer-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-family: inherit;
  line-height: 1.5;
  padding: 8px 0;
  min-height: 40px;
  overflow: hidden;
}
.composer-textarea::placeholder { color: var(--text-sub); }
.composer-row {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.composer-post {
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 9999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.composer-post:hover { filter: brightness(1.06); }

/* ---------- ツイート ---------- */
.tweet {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.tweet-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sk-base);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tweet-avatar svg {
  width: 60%;
  height: 60%;
  margin-top: 18%;
  fill: var(--silhouette);
}
.composer .tweet-avatar { width: 40px; height: 40px; }
.lnav-profile .tweet-avatar { width: 40px; height: 40px; }

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

.tweet-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.tweet-name { height: 14px; border-radius: 7px; }
.tweet-handle { height: 10px; border-radius: 5px; }
.tweet-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sk-base);
  flex-shrink: 0;
}
.tweet-time { width: 26px; height: 10px; border-radius: 5px; }

.tweet-line {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.tweet-seg { height: 13px; border-radius: 6px; }

/* メディア枠: 薄い境界線 + 角丸16px */
.tweet-media {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--media-border);
}
.media-cell {
  background: var(--media-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-cell svg {
  width: 34px;
  height: 34px;
  stroke: var(--media-icon);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.media-cell .play-icon {
  width: 52px;
  height: 52px;
  fill: var(--media-icon);
  stroke: none;
}
.media-single-wide { aspect-ratio: 16 / 9; }
.media-single-square { aspect-ratio: 1 / 1; max-height: 420px; }

.media-grid {
  display: grid;
  gap: 2px;
  aspect-ratio: 16 / 10;
}
.media-grid-2 { grid-template-columns: 1fr 1fr; }
.media-grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.media-grid-3 .media-cell:first-child { grid-row: span 2; }
.media-grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.media-grid .media-cell svg { width: 26px; height: 26px; }

/* ---------- アクションボタン ---------- */
.tweet-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.tweet-actions-left {
  display: flex;
  flex: 1;
  justify-content: space-between;
  max-width: 310px;
  margin-right: 16px;
}
.tweet-actions-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tweet-action {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--icon);
  transition: color 0.15s;
  position: relative;
}
.tweet-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}
.tweet-action:hover { color: var(--icon-active); }
.tweet-action-num {
  font-size: 12px;
  line-height: 1;
  color: inherit;
  min-width: 1ch;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tweet-action.is-liked { color: #f91880; }
.tweet-action.is-liked svg { fill: #f91880; }
.tweet-action.is-reposted { color: #00ba7c; }
.tweet-action.is-bookmarked { color: #1d9bf0; }
.tweet-action.is-bookmarked svg { fill: #1d9bf0; }
.tweet-action.is-liked svg,
.tweet-action.is-reposted svg,
.tweet-action.is-bookmarked svg {
  animation: action-pop 0.3s ease;
}
@keyframes action-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* リポストのポップアップメニュー */
.repost-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: -8px;
  z-index: 40;
  min-width: 150px;
  padding: 6px 0;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--menu-shadow);
}
.repost-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
}
.repost-menu-item:hover { background: var(--sk-light); }
.repost-menu-item svg {
  width: 17px;
  height: 17px;
  stroke: var(--icon-active);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.repost-menu-bar {
  height: 12px;
  border-radius: 6px;
  background: var(--sk-strong);
}

.tl-sentinel { height: 2px; }

/* コメント欄 (ツイート/メモ共通、画像+文字のスケルトン) */
.tweet-actions-wrap { display: block; }
.comments-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comment-row {
  display: flex;
  gap: 10px;
}
.comment-row .tweet-avatar { width: 32px; height: 32px; }
.comment-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-name-bar { height: 11px; border-radius: 5px; }
.comment-time-bar { width: 28px; height: 9px; border-radius: 4px; }
.comment-text-bar { height: 11px; border-radius: 5px; }
.comment-image {
  width: 100%;
  max-width: 220px;
  height: 120px;
  border-radius: 12px;
  margin-top: 2px;
}

/* コメントスレッド (他人からの返信が連なる表示) */
.comment-thread { display: flex; flex-direction: column; gap: 10px; }
.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 42px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.comment-row-nested .tweet-avatar { width: 26px; height: 26px; }

/* ツイート詳細表示 (カードをタップで開く拡大ビュー) */
.tweet-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(91, 112, 131, 0.4);
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.tweet-detail-modal {
  width: 600px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.tweet-detail-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  margin: 12px 0 0 4px;
}
.tweet-detail-close:hover { background: var(--sk-light); }
.tweet-detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 40px;
}
.tweet-detail-main {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tweet-detail-main .tweet-avatar { width: 52px; height: 52px; }
.tweet-detail-main .tweet-name { height: 18px; }
.tweet-detail-main .tweet-handle,
.tweet-detail-main .tweet-time { height: 13px; }
.tweet-detail-main .memo-name,
.tweet-detail-main .memo-handle { font-size: 16px; }
.tweet-detail-main .tweet-seg { height: 16px; }
.tweet-detail-main .memo-tweet-text { font-size: 18px; }
.tweet-detail-comments { border-top: none; padding-top: 0; margin-top: 0; }

/* メモの実テキストヘッダー */
.memo-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.memo-handle {
  font-size: 13px;
  color: var(--text-sub);
  white-space: nowrap;
}

/* 投稿中スピナー (疑似通信) */
.composer-post.is-posting {
  color: transparent;
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}
.composer-post.is-posting::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: post-spin 0.7s linear infinite;
}
@keyframes post-spin {
  to { transform: rotate(360deg); }
}

/* メモの「…」メニュー */
.memo-more {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.memo-more:hover { background: var(--sk-light); }
.more-icon {
  width: 17px;
  height: 17px;
  fill: var(--icon);
}
.memo-more:hover .more-icon { fill: var(--icon-active); }
.more-menu {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 40;
  min-width: 130px;
  padding: 4px 0;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--menu-shadow);
}
.more-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
}
.more-menu-item:hover { background: var(--sk-light); }
.more-menu-item svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.more-menu-delete { color: #f4212e; }

/* 左ナビ「もっと見る」ドロップダウン */
.lnav-item { position: relative; }
.lnav-more-menu {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  z-index: 40;
  min-width: 220px;
  padding: 6px 0;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--menu-shadow);
}
.lnav-more-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}
.lnav-more-menu-item:hover { background: var(--sk-light); }
.lnav-more-menu-item svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* 設定モーダル (再生リストURL設定) */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.settings-modal {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  background: var(--bg);
  padding: 24px;
  box-shadow: var(--menu-shadow);
}
.settings-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 16px;
}
.settings-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.settings-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 8px;
}
.settings-hint {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 20px;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.settings-btn {
  padding: 9px 18px;
  border-radius: 9999px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.settings-btn-cancel { background: var(--sk-light); color: var(--text); }
.settings-btn-save { background: var(--accent); color: #ffffff; }

.settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.settings-switch-label { margin-bottom: 0; }
.settings-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border: none;
  border-radius: 9999px;
  background: var(--sk-base);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.settings-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s;
}
.settings-switch.is-on { background: var(--accent); }
.settings-switch.is-on::after { transform: translateX(18px); }

/* ショートのコメントシート (下からせり上がる、文字のみ) */
.short-comments-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.short-comments-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: #16181c;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  animation: short-comments-up 0.25s ease;
}
@keyframes short-comments-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.short-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #2f3336;
}
.short-comments-title {
  font-size: 15px;
  font-weight: 700;
  color: #e7e9ea;
}
.short-comments-close {
  border: none;
  background: none;
  color: #e7e9ea;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}
.short-comments-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.short-comments-list .comment-name-bar,
.short-comments-list .comment-text-bar { background: #3a3d40; }
.short-comments-list .comment-time-bar { background: #26292c; }
.short-comments-list .tweet-avatar { background: #2a2a2a; }
.short-comments-list .tweet-avatar svg { fill: #555555; }

/* メモのツイート形式表示 */
.memo-tweet-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}
#memo-feed:empty::after {
  content: "まだメモはありません。「ツイートする」から最初のメモを残そう";
  display: block;
  padding: 40px 32px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
}

/* ---------- 投稿モーダル (X風) ---------- */
.compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(91, 112, 131, 0.4);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 5vh 16px 0;
}
@media (prefers-color-scheme: dark) {
  .compose-overlay { background: rgba(91, 112, 131, 0.25); }
}
.compose-modal {
  width: 600px;
  max-width: 100%;
  background: var(--bg);
  border-radius: 16px;
  padding: 12px 16px 16px;
  box-shadow: var(--menu-shadow);
}
.compose-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 4px;
}
.compose-close:hover { background: var(--sk-light); }
.compose-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.compose-modal-textarea { min-height: 120px; }

/* ---------- 右カラム: サイドバー ---------- */
.col-right {
  width: 350px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  margin-left: 28px;
  padding: 8px 8px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  scrollbar-width: none;
}
.col-right::-webkit-scrollbar { display: none; }
.sb-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--sk-light);
  flex-shrink: 0;
}
.sb-search svg {
  width: 18px;
  height: 18px;
  stroke: var(--icon);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.sb-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.sb-search-input::placeholder { color: var(--text-sub); }

.sb-panel {
  border-radius: 16px;
  background: var(--panel);
  padding: 14px 16px;
  flex-shrink: 0;
}
.sb-panel-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}

/* My Notes (Private) */
.notes-list { display: flex; flex-direction: column; }
.notes-list:empty::after {
  content: "まだメモはありません";
  font-size: 13px;
  color: var(--text-sub);
}
.note-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.note-item:last-child { border-bottom: none; }
.note-item .tweet-avatar { width: 32px; height: 32px; }
.note-body {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  padding-top: 5px;
}

.trend-item { padding: 10px 0; cursor: pointer; }
.trend-cat { font-size: 12px; color: var(--text-sub); margin-bottom: 3px; }
.trend-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.trend-posts { font-size: 12px; color: var(--text-sub); }

.follow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.follow-bars { flex: 1; min-width: 0; }
.follow-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.follow-id { font-size: 13px; color: var(--text-sub); }
.follow-btn {
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 9999px;
  background: var(--follow-btn);
  color: var(--follow-bar);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.follow-btn:hover { opacity: 0.85; }

/* ================= 画面B: ショート ================= */
/* ショート表示中はタイムラインDOMを非表示にする (左ナビは残す) */
.shorts-mode .col-center,
.shorts-mode .col-right { display: none; }

/* col-center/col-right を消すと残った col-left が layout の
   justify-content:center により中央に浮いてしまうため左詰めにする */
.shorts-mode .layout { justify-content: flex-start; }

/* ショート表示中も左ナビの配色は変更しない (常時ダークモード設定に委ねる) */

.screen-shorts {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  background: #000000;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 8;
  overscroll-behavior: contain;
}
.screen-shorts::-webkit-scrollbar { display: none; }

.short-frame {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000000;
  overflow: hidden;
}

/* 右側アクションボタン群 (右下・縦並び) */
.short-actions {
  position: absolute;
  right: 10px;
  bottom: 96px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.short-profile {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1.5px solid #4a4a4a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.short-profile svg {
  width: 60%;
  height: 60%;
  margin-top: 18%;
  fill: #555555;
}
.short-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.short-action {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #d0d0d0;
  transition: color 0.15s;
}
.short-action svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}
.short-action.is-liked { color: #f91880; }
.short-action.is-liked svg { fill: #f91880; }
.short-action.is-bookmarked { color: #1d9bf0; }
.short-action.is-bookmarked svg { fill: #1d9bf0; }
.short-action.is-liked svg,
.short-action.is-bookmarked svg { animation: action-pop 0.3s ease; }
.short-count {
  font-size: 12px;
  font-weight: 600;
  color: #d0d0d0;
  font-variant-numeric: tabular-nums;
}

/* 左下ユーザー情報 */
.short-info {
  position: absolute;
  left: 14px;
  right: 84px;
  bottom: 40px;
  z-index: 2;
}
.short-info-name {
  width: 120px;
  height: 15px;
  border-radius: 8px;
  background: #8a8a8a;
  margin-bottom: 12px;
}
.short-info-caption {
  height: 11px;
  border-radius: 6px;
  background: #3a3a3a;
  margin-bottom: 8px;
}
.short-info-hashtag {
  height: 11px;
  border-radius: 6px;
  background: #2e3f4d;
}

/* シークバー (最下部・左から右へ自走) */
.short-seekbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 3;
}
.short-seek-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #f0f0f0;
  animation: short-seek linear infinite;
}
@keyframes short-seek {
  0% { width: 0; }
  100% { width: 100%; }
}

/* 背景: 1枚ごとにJSでグラデを生成。Ken Burns風にパン&ズーム */
.short-bg {
  position: absolute;
  inset: -8%;
  z-index: 0;
  transform-origin: center;
  will-change: transform;
  animation: short-kenburns ease-in-out infinite alternate;
}
@keyframes short-kenburns {
  0% {
    transform: translate(var(--x1, 0), var(--y1, 0)) scale(var(--z1, 1.05));
  }
  100% {
    transform: translate(var(--x2, 0), var(--y2, 0)) scale(var(--z2, 1.2));
  }
}

/* BGMプレイヤー (YouTube): ウィジェット単位でまとめて位置を管理。
   モバイル/デフォルトは左上、PC (>=1000px) はショート枠の右外側に表示 */
.short-music-widget {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 11;
  width: 200px;
  display: none;
}
.shorts-mode .short-music-widget { display: block; }

.short-music {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}
.short-music.is-hidden { visibility: hidden; }
.short-music iframe { display: block; }

/* プレイヤー右上に重ねる操作ボタン群 */
.short-music-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 12;
  display: flex;
  gap: 6px;
}
.short-music-btn,
.short-music-panel-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.short-music-hint {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 11px;
  font-family: system-ui, sans-serif;
  display: inline-block;
}

/* トースト通知 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 30px);
  transform: translateX(-50%) translateY(10px);
  z-index: 60;
  padding: 10px 18px;
  border-radius: 9999px;
  background: rgba(15, 20, 25, 0.9);
  color: #ffffff;
  font-size: 13px;
  font-family: system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 実写画像 (Picsum) */
.short-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.short-photo.is-loaded { opacity: 1; }

/* オーロラの光の塊 */
.short-blob {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(30px);
  will-change: transform;
  animation: short-drift ease-in-out infinite alternate;
}
@keyframes short-drift {
  0% { transform: translate(0, 0) scale(var(--s1, 0.95)); }
  100% { transform: translate(var(--dx, 8%), var(--dy, 6%)) scale(var(--s2, 1.1)); }
}

/* ボケ玉: 下から上へゆっくり昇る */
.short-bokeh {
  position: absolute;
  bottom: -20%;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
  will-change: transform;
  animation: short-float linear infinite;
}
@keyframes short-float {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(-130vh); opacity: 0.2; }
}

/* 動くパターン: 背景位置が流れ続ける */
.short-bg-pattern {
  animation-name: short-pattern-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes short-pattern-scroll {
  0% { background-position: 0 0; }
  100% { background-position: 60vmin 60vmin; }
}

/* 波レイヤー: 左右にゆったり揺れる */
.short-wave {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 34%;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  animation: short-sway ease-in-out infinite alternate;
}
@keyframes short-sway {
  0% { transform: translateX(-6%); }
  100% { transform: translateX(6%); }
}

/* 下部スクリム: アイコンとバーの可読性を守る */
.short-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.25) 0%,
    transparent 25%,
    transparent 55%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

/* 光が斜めに横切るライトリーク (動画っぽさ) */
.short-streak {
  position: absolute;
  top: -30%;
  left: 0;
  width: 45%;
  height: 160%;
  z-index: 1;
  pointer-events: none;
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  animation: short-sweep ease-in-out infinite;
}
@keyframes short-sweep {
  0% { transform: translateX(-160%) rotate(18deg); }
  55%, 100% { transform: translateX(320%) rotate(18deg); }
}

/* エッジを暗くするビネット */
.short-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* 動きを控えたいユーザーには静止させる (アクセシビリティ) */
@media (prefers-reduced-motion: reduce) {
  .short-bg, .short-blob, .short-bokeh, .short-wave,
  .short-streak, .short-seek-fill { animation: none; }
  .short-bokeh { bottom: 30%; opacity: 0.6; }
  .short-seek-fill { width: 30%; }
}

/* モバイルではボトムナビの上に配置 */
@media (max-width: 699px) {
  .short-actions { bottom: calc(var(--nav-h) + 80px); }
  .short-info { bottom: calc(var(--nav-h) + 30px); }
  .short-seekbar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
}

/* ================= ボトムタブバー (モバイル) ================= */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bnav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}
.bnav-item svg {
  width: 24px;
  height: 24px;
  stroke: var(--icon);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bnav-item.is-active svg {
  stroke: var(--nav-icon-active);
  stroke-width: 2.4;
}

/* ================= レスポンシブ ================= */

/* PC (>=1000px): 3カラム。ボトムバー非表示 */
@media (min-width: 1000px) {
  .bottom-nav { display: none; }

  /* ショートモード: col-left(275px)の右側の余白内で9:16の枠を中央配置し、
     YouTubeプレイヤーはその枠の外側(右)に並べる */
  body.shorts-mode {
    --shorts-box-h: 100vh;
    --shorts-box-w: calc(var(--shorts-box-h) * 9 / 16);
    --shorts-region-center: calc((100vw + 275px) / 2);
    --shorts-box-left: calc(var(--shorts-region-center) - var(--shorts-box-w) / 2);
  }
  .shorts-mode .screen-shorts {
    top: 0;
    left: var(--shorts-box-left);
    right: auto;
    bottom: auto;
    transform: none;
    width: var(--shorts-box-w);
    height: var(--shorts-box-h);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }
  .shorts-mode .short-frame { height: 100%; }
  .shorts-mode .short-music-widget {
    top: 50%;
    left: calc(var(--shorts-box-left) + var(--shorts-box-w) + 20px);
    transform: translateY(-50%);
  }
}

/* タブレット (700〜999px): 左カラムはアイコンのみ、右カラム非表示 */
@media (min-width: 700px) and (max-width: 999px) {
  .bottom-nav { display: none; }
  .col-right { display: none; }
  .col-left { width: 72px; padding: 8px 6px 16px; align-items: center; }
  .lnav-logo { margin-left: 0; }
  .lnav-item { gap: 0; padding: 11px; }
  .lnav-item-label { display: none; }
  .lnav-post { width: 50px; height: 50px; font-size: 0; }
  .lnav-profile { padding: 6px; }
  .lnav-profile-bars { display: none; }
}

/* モバイル (<700px): 中央カラムのみ + ボトムタブバー */
@media (max-width: 699px) {
  .col-left, .col-right { display: none; }
  .col-center {
    width: 100%;
    max-width: 100%;
    border-left: none;
    border-right: none;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px);
  }
}
