/* 3列（メニュー / タイムライン / サイド）。スマホでは1列＋下のタブバー */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f5f0;
  --bg-blur: rgba(255, 255, 255, 0.86);
  --fg: #16140f;
  --fg-muted: #6e6a5e;
  --line: #ebe8de;
  --accent: #ffc531;
  --accent-ink: #1a1405;
  --accent-soft: #fff3cc;
  --accent-text: #9a6500;
  --danger: #d9304f;
  --danger-soft: #fde8ec;
  --live: #e5484d;
  --overlay: rgba(22, 20, 15, 0.42);
  --shadow: 0 10px 30px rgba(22, 20, 15, 0.14), 0 0 0 1px var(--line);
  --av0: #ffe9a8; --av1: #ffd6c9; --av2: #d8ecff; --av3: #d9f2dc;
  --av4: #ecdcff; --av5: #ffd9ec; --av6: #d4f1ef; --av7: #f1e6d2;

  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
  --display: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif;
  --emoji: "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Emoji", "Twemoji Mozilla", sans-serif;

  --col: 600px;
  color-scheme: light;
}
/* 既定は白×黄。ダークは data-theme="dark" のときだけ（切り替えボタンで選ぶ） */
:root[data-theme="dark"] {
  --bg: #100f0c; --bg-soft: #1b1914; --bg-blur: rgba(16, 15, 12, 0.84);
  --fg: #f3f0e7; --fg-muted: #948f80; --line: #2b2821;
  --accent-soft: #2f2610; --accent-text: #ffd361;
  --danger: #ff5d7a; --danger-soft: #3a1820;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line);
  --av0: #4a3b12; --av1: #4a2a22; --av2: #1e3550; --av3: #1f3d26;
  --av4: #33264d; --av5: #4a2238; --av6: #183f3c; --av7: #3e3424;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.emo { font-family: var(--emoji); font-weight: 400; }
.muted { color: var(--fg-muted); }
.num { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; text-align: center; }

/* ---------- レイアウト ---------- */
.app { display: flex; justify-content: center; min-height: 100vh; }
.rail {
  width: 260px; flex: none;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 12px 16px;
}
.column {
  width: var(--col); max-width: 100%; flex: none;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  min-height: 100vh; padding-bottom: 40px;
}
.side {
  width: 350px; flex: none;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 10px 0 24px 28px;
  display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: none;
}
.boot { display: grid; place-items: center; padding: 80px 0; }

/* ---------- 左メニュー ---------- */
.logo { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 999px; width: fit-content; }
.logo:hover { background: var(--bg-soft); }
.logo-mark { width: 34px; height: 34px; display: block; }
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-word { font-family: var(--display); font-size: 24px; letter-spacing: 0.02em; line-height: 1; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 18px;
  padding: 11px 14px; border-radius: 999px; width: fit-content;
  font-size: 19px; font-weight: 500;
}
.nav-item:hover { background: var(--bg-soft); }
.nav-item.on { font-weight: 800; }
.nav-item .ico { position: relative; width: 27px; height: 27px; }
.nav-item.on .ico svg { stroke-width: 2.6; }
.ico svg, .icon-btn > svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge {
  position: absolute; top: -5px; right: -8px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.rail-post { margin-top: 14px; width: 92%; padding: 14px 0; font-size: 17px; }
.rail-post .ico { display: none; width: 24px; height: 24px; }
.account {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 999px; width: 100%; text-align: left;
}
.account:hover { background: var(--bg-soft); }
.account-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.account .ico { width: 20px; height: 20px; }
.rail-auth { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 6px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 8px 18px; font-weight: 800; font-size: 15px;
  line-height: 1.2; white-space: nowrap; transition: background-color 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #f5b800; }
.btn-primary:disabled { opacity: 0.45; }
.btn-ink { background: var(--fg); color: var(--bg); }
.btn-ink:hover { opacity: 0.86; }
.btn-outline { border: 1px solid var(--line); color: var(--fg); background: transparent; }
.btn-outline:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-follow.following .hover-label { display: none; }
.btn-follow.following:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn-follow.following:hover .label { display: none; }
.btn-follow.following:hover .hover-label { display: inline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; flex: none;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn .ico, .icon-btn > svg { width: 21px; height: 21px; }
.icon-btn.accent { color: var(--accent-text); }
.icon-btn.accent:hover { background: var(--accent-soft); }

/* ---------- 列の見出し ---------- */
.col-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-blur);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.col-title-row { display: flex; align-items: center; gap: 22px; min-height: 53px; padding: 4px 16px; }
.col-title { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.col-sub { font-size: 13px; color: var(--fg-muted); }
.mobile-bar { display: none; }
.tabs { display: flex; }
.tab {
  flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px;
  height: 53px; color: var(--fg-muted); font-weight: 500; position: relative;
}
.tab:hover { background: var(--bg-soft); }
.tab.on { color: var(--fg); font-weight: 800; }
.tab.on::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 4px; background: var(--accent);
}
.live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--live);
}
.live-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}
.live-dot.off { color: var(--fg-muted); }
.live-dot.off::before { animation: none; }
@keyframes pulse { 50% { opacity: 0.25; } }
.live-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  font-size: 13px; color: var(--fg-muted); border-bottom: 1px solid var(--line);
}
.live-bar strong { color: var(--fg); font-weight: 800; }

/* ---------- アバター ---------- */
.avatar {
  --s: 40px;
  width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--emoji); font-size: calc(var(--s) * 0.56); line-height: 1;
  user-select: none;
}
a.avatar:hover { filter: brightness(0.95); }
.av-0 { background: var(--av0); } .av-1 { background: var(--av1); } .av-2 { background: var(--av2); } .av-3 { background: var(--av3); }
.av-4 { background: var(--av4); } .av-5 { background: var(--av5); } .av-6 { background: var(--av6); } .av-7 { background: var(--av7); }

/* ---------- 投稿 ---------- */
.post {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 12px 16px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer; position: relative;
}
.post:hover { background: var(--bg-soft); }
.post.fresh { animation: drop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes drop-in {
  from { opacity: 0; transform: translateY(-14px); background: var(--accent-soft); }
  60% { background: var(--accent-soft); }
}
.post.has-line { border-bottom: 0; }
.post.has-line .post-side::after {
  content: ""; position: absolute; top: 56px; bottom: -6px; left: 35px; width: 2px; background: var(--line);
}
.post-side { display: flex; flex-direction: column; align-items: center; }
.post-main { min-width: 0; }
.post-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 15px; }
.handle { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.user-row .handle { display: block; }
.handle:hover { text-decoration: underline; }
.handle .at { font-family: var(--font); color: var(--fg-muted); font-weight: 500; margin-right: 1px; }
.post-time { color: var(--fg-muted); white-space: nowrap; flex: none; }
.post-time:hover { text-decoration: underline; }
.reply-to { font-size: 14px; color: var(--fg-muted); margin-top: 1px; }
.reply-to a { color: var(--accent-text); }
.body {
  font-family: var(--emoji); font-size: 24px; line-height: 1.42;
  white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px;
}
.body.jumbo { font-size: 46px; line-height: 1.2; margin: 6px 0 2px; }
.body .e { border-radius: 8px; transition: background-color 0.12s; }
.body .e:hover { background: var(--accent-soft); }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reacts:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px 0 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 13px; font-weight: 700; color: var(--fg-muted);
  transition: transform 0.12s, background-color 0.12s;
}
.chip .emo { font-size: 16px; line-height: 1; }
.chip:hover { border-color: var(--accent); }
.chip.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.18); } }
.actions { display: flex; align-items: center; gap: 4px; margin: 4px 0 0 -8px; color: var(--fg-muted); max-width: 420px; justify-content: space-between; }
.act {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 8px 0 0;
  border-radius: 999px; font-size: 13px; color: var(--fg-muted);
}
.act .ico { width: 34px; height: 34px; padding: 8px; border-radius: 999px; transition: background-color 0.12s; }
.act:hover { color: var(--accent-text); }
.act:hover .ico { background: var(--accent-soft); }
.act.danger:hover { color: var(--danger); }
.act.danger:hover .ico { background: var(--danger-soft); }
.post.detail { grid-template-columns: 48px minmax(0, 1fr); cursor: default; padding-top: 14px; }
.post.detail:hover { background: transparent; }
.post.detail .post-head { flex-direction: column; gap: 0; align-self: center; }
.post.detail .body-wrap { grid-column: 1 / -1; }
.post.detail .body { font-size: 30px; }
.post.detail .body.jumbo { font-size: 64px; }
.detail-meta { color: var(--fg-muted); padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.detail-stats { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--fg-muted); }
.detail-stats strong { color: var(--fg); font-weight: 800; }
.post.detail .actions { max-width: none; justify-content: space-around; margin: 0; padding: 4px 0; border-bottom: 1px solid var(--line); }
.deleted-box {
  grid-column: 1 / -1; padding: 14px 16px; border-radius: 14px; background: var(--bg-soft);
  color: var(--fg-muted); font-size: 14px; margin-bottom: 6px;
}
.post.compact { cursor: default; border-bottom: 0; padding-bottom: 0; }
.post.compact:hover { background: transparent; }

/* ---------- 投稿欄 ---------- */
.composer {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.composer.in-modal { border-bottom: 0; padding: 4px 0 0; }
.compose-main { min-width: 0; }
.compose-input {
  display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent; color: var(--fg);
  font-family: var(--emoji); font-size: 24px; line-height: 1.4; padding: 6px 0; min-height: 52px; max-height: 50vh;
}
.compose-input::placeholder { font-family: var(--font); font-size: 19px; color: var(--fg-muted); opacity: 1; }
.compose-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px;
}
.compose-tools { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.quick { display: flex; gap: 0; }
.quick button {
  width: 32px; height: 32px; border-radius: 8px; font-family: var(--emoji); font-size: 19px; line-height: 1;
}
.quick button:hover { background: var(--accent-soft); }
.compose-send { display: flex; align-items: center; gap: 12px; flex: none; }
.ring { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.5; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.15s; }
.ring.warn .ring-fg { stroke: #f08c00; }
.ring.over .ring-fg { stroke: var(--danger); }
.ring-n { font-size: 11px; font-weight: 700; color: var(--fg-muted); position: relative; }
.ring.over .ring-n { color: var(--danger); }
.hint {
  font-size: 13px; color: var(--danger); font-weight: 700;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.2s, opacity 0.2s;
}
.hint.show { max-height: 40px; opacity: 1; padding: 2px 0; }
.shake { animation: shake 0.36s; }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}

/* ---------- タイムライン ---------- */
.feed-more { display: grid; place-items: center; min-height: 80px; padding: 16px; }

/* ---------- 広告 ---------- */
/* 高さを先に取っておき、読み込みで画面がずれないようにする。埋まらなかった枠はたたむ */
.ad { position: relative; overflow: hidden; }
.ad-label {
  font-size: 11px; font-weight: 700; color: var(--fg-muted); letter-spacing: 0.04em; line-height: 1;
}
.ad-feed { padding: 10px 16px 14px; border-bottom: 1px solid var(--line); min-height: 290px; }
.ad-feed .ad-label { margin-bottom: 8px; }
.ad-open {
  display: flex; align-items: center; gap: 8px; height: 58px; padding: 4px 12px; flex: none;
  border-bottom: 1px solid var(--line);
}
.ad-open .ad-label { writing-mode: vertical-rl; flex: none; }
.ad-open > :last-child:not(.ad-label) { flex: 1; min-width: 0; }
.ad:has(ins[data-ad-status='unfilled']) { display: none; }
.ad-demo {
  display: grid; place-items: center; border-radius: 12px; background: var(--bg-soft);
  border: 1px dashed var(--line); color: var(--fg-muted); font-size: 13px; font-weight: 700;
}
.ad-feed .ad-demo { height: 250px; }
.ad-open .ad-demo { height: 50px; }
.feed-end { color: var(--line); font-size: 24px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.new-pill {
  position: sticky; top: 118px; z-index: 15; display: block; margin: 8px auto -44px;
  padding: 8px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.empty { padding: 48px 32px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.empty-emo { font-family: var(--emoji); font-size: 54px; line-height: 1.1; }
.empty-title { font-size: 22px; font-weight: 800; margin-top: 6px; text-wrap: balance; }
.empty-text { color: var(--fg-muted); max-width: 34ch; }
.error-box { padding: 32px; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--fg-muted); }

.welcome { padding: 22px 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.welcome-emo { font-family: var(--emoji); font-size: 40px; line-height: 1.1; letter-spacing: 0.06em; }
.welcome h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.3; letter-spacing: 0.01em; text-wrap: balance; }
.welcome p { margin: 0; color: var(--fg-muted); max-width: 46ch; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.login-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--fg-muted);
}

/* ---------- プロフィール ---------- */
.banner { height: 150px; position: relative; overflow: hidden; }
.banner-emo {
  position: absolute; inset: -20px; font-family: var(--emoji); font-size: 34px; line-height: 1.6;
  opacity: 0.22; word-break: break-all; letter-spacing: 0.5em; transform: rotate(-8deg);
}
.profile { padding: 0 16px 14px; border-bottom: 1px solid var(--line); }
.profile-top { display: flex; justify-content: space-between; align-items: flex-start; margin-top: -54px; position: relative; z-index: 1; }
.profile-top .avatar { box-shadow: 0 0 0 4px var(--bg); }
.profile-actions { display: flex; gap: 8px; margin-top: 66px; }
.profile-handle { font-size: 24px; font-weight: 800; margin: 10px 0 0; overflow-wrap: anywhere; line-height: 1.3; }
.profile-handle .at { font-family: var(--font); color: var(--fg-muted); font-weight: 500; }
.follows-you { display: inline-block; font-size: 12px; background: var(--bg-soft); color: var(--fg-muted); padding: 1px 6px; border-radius: 4px; margin-top: 4px; }
.profile-bio { margin-top: 10px; }
.profile-bio .body { font-size: 22px; }
.profile-meta { display: flex; align-items: center; gap: 6px; color: var(--fg-muted); margin-top: 10px; }
.profile-meta .ico { width: 18px; height: 18px; }
.profile-counts { display: flex; gap: 18px; margin-top: 10px; }
.profile-counts a:hover { text-decoration: underline; }
.profile-counts strong { font-weight: 800; margin-right: 3px; }

.user-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.user-row:hover { background: var(--bg-soft); }
.user-row .bio { font-family: var(--emoji); font-size: 15px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 話題・検索 ---------- */
.search-form { position: relative; }
.search-form .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fg-muted); pointer-events: none; }
.search-input {
  width: 100%; height: 44px; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg-soft); color: var(--fg); padding: 0 16px 0 46px;
  font-family: var(--emoji); font-size: 17px; outline: none;
}
.search-input::placeholder { font-family: var(--font); font-size: 15px; color: var(--fg-muted); }
.search-input:focus { border-color: var(--accent); background: var(--bg); }
.col-search { padding: 6px 16px 10px; }
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.trend-tile { background: var(--bg); padding: 16px; display: grid; gap: 2px; }
.trend-tile:hover { background: var(--bg-soft); }
.trend-tile .rank { font-size: 12px; color: var(--fg-muted); }
.trend-tile .emo { font-size: 44px; line-height: 1.15; }
.trend-tile .cnt { font-size: 13px; color: var(--fg-muted); }
.section-label { padding: 14px 16px 6px; font-size: 13px; font-weight: 800; color: var(--fg-muted); letter-spacing: 0.04em; }

/* ---------- 通知 ---------- */
.notif { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif:hover { background: var(--bg-soft); }
.notif.new { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif-icon { display: grid; justify-items: end; }
.notif-icon .ico { width: 28px; height: 28px; color: var(--accent-text); }
.notif-icon .emo { font-size: 28px; line-height: 1; }
.notif-main { min-width: 0; display: grid; gap: 6px; }
.notif-text { font-size: 15px; }
.notif-text b { font-weight: 800; }
.notif-body { font-family: var(--emoji); font-size: 18px; color: var(--fg-muted); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- サイド ---------- */
.card { background: var(--bg-soft); border-radius: 16px; overflow: hidden; }
.card-title { padding: 12px 16px 4px; font-size: 19px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
.card-title small { font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.trend-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; }
.trend-row:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.trend-row .rank { width: 16px; font-size: 13px; color: var(--fg-muted); text-align: right; }
.trend-row .emo { font-size: 26px; line-height: 1; }
.trend-row .cnt { margin-left: auto; font-size: 13px; color: var(--fg-muted); }
.side .user-row { border-bottom: 0; padding: 10px 16px; }
.side .user-row:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.card-empty { padding: 8px 16px 16px; color: var(--fg-muted); font-size: 14px; }
.card-pad { height: 8px; }
.side-foot { font-size: 12px; color: var(--fg-muted); padding: 0 16px; line-height: 1.7; }

/* ---------- モーダル ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay);
  display: flex; justify-content: center; align-items: flex-start; padding: 6vh 16px 24px; overflow-y: auto;
}
.dialog {
  width: 100%; max-width: 560px; background: var(--bg); border-radius: 18px;
  box-shadow: var(--shadow); padding: 0 20px 20px; animation: rise 0.18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { display: flex; align-items: center; gap: 10px; height: 54px; margin: 0 -8px; }
.dialog-title { font-weight: 800; font-size: 18px; }
.auth { display: grid; gap: 16px; padding-bottom: 4px; }
.auth h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.3; text-wrap: balance; }
.auth-lead { margin: -8px 0 0; color: var(--fg-muted); }
.auth-reason { background: var(--accent-soft); color: var(--accent-text); padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 800; color: var(--fg-muted); letter-spacing: 0.03em; }
.field-row {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px;
  padding: 4px 6px 4px 14px; transition: border-color 0.15s;
}
.field-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg);
  font-family: var(--emoji); font-size: 26px; height: 46px; padding: 0;
}
textarea.field-input { height: auto; min-height: 90px; font-size: 22px; padding: 8px 0; resize: vertical; line-height: 1.4; }
.field-input::placeholder { font-family: var(--font); font-size: 15px; color: var(--fg-muted); }
.field-note { font-size: 13px; color: var(--fg-muted); }
.field-status { font-size: 13px; font-weight: 700; min-height: 1.4em; }
.field-status.ok { color: #1f8a4c; }
.field-status.ng { color: var(--danger); }
.auth-switch { text-align: center; color: var(--fg-muted); font-size: 14px; }
.auth-switch button { color: var(--accent-text); font-weight: 800; }
.auth-switch button:hover { text-decoration: underline; }
.form-error { color: var(--danger); font-weight: 700; font-size: 14px; min-height: 1.4em; }
.passcard {
  border-radius: 16px; padding: 20px; display: grid; gap: 8px; justify-items: center; text-align: center;
  background: var(--accent-soft); border: 2px dashed var(--accent);
}
.passcard .big { font-family: var(--emoji); font-size: 44px; letter-spacing: 0.1em; line-height: 1.2; }
.passcard .label { font-size: 12px; font-weight: 800; color: var(--accent-text); letter-spacing: 0.06em; }
.avatar-pick { display: flex; align-items: center; gap: 16px; }
.confirm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.menu-pop {
  position: fixed; z-index: 120; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow);
  padding: 6px 0; min-width: 220px;
}
.menu-pop button { display: block; width: 100%; text-align: left; padding: 11px 16px; font-weight: 700; }
.menu-pop button:hover { background: var(--bg-soft); }

/* ---------- 絵文字ピッカー ---------- */
.picker-pop { position: fixed; z-index: 130; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
emoji-picker {
  --background: var(--bg);
  --border-color: transparent;
  --border-size: 0;
  --input-border-color: var(--line);
  --input-font-color: var(--fg);
  --input-placeholder-color: var(--fg-muted);
  --input-border-radius: 999px;
  --indicator-color: var(--accent);
  --button-hover-background: var(--bg-soft);
  --button-active-background: var(--accent-soft);
  --category-font-color: var(--fg-muted);
  --outline-color: var(--accent);
  --emoji-font-family: var(--emoji);
  --num-columns: 8;
  --emoji-size: 1.45rem;
  width: 352px; height: 400px;
}

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translateX(-50%);
  background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); max-width: calc(100vw - 32px);
}
.toast.show { animation: rise 0.2s ease-out; }

/* ---------- スマホのタブバーと投稿ボタン ---------- */
.tabbar, .fab { display: none; }

/* ---------- 画面幅ごと ---------- */
@media (max-width: 1280px) {
  .rail { width: 88px; align-items: center; padding-inline: 8px; }
  .logo-word, .nav-item .label, .account-name, .account > .ico, .rail-post .label { display: none; }
  .nav-item { padding: 12px; }
  .rail-post { width: 52px; height: 52px; padding: 0; }
  .rail-post .ico { display: block; }
  .account { width: auto; padding: 8px; }
  .rail-auth .btn { padding: 10px; }
  .rail-auth .label-long { display: none; }
}
@media (min-width: 1281px) { .rail-auth .label-short { display: none; } }
@media (max-width: 1280px) { .rail-auth .label-short { display: inline; } }
@media (max-width: 1040px) { .side { display: none; } }
@media (max-width: 640px) {
  .rail { display: none; }
  .column { border: 0; width: 100%; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .post, .composer, .user-row, .notif, .login-prompt, .welcome, .profile, .col-title-row, .live-bar, .col-search { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .col-head { top: 0; }
  .mobile-bar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; justify-items: center; height: 53px; padding: 0 16px; }
  .mobile-bar .logo { padding: 4px; }
  .mobile-bar .logo-mark { width: 30px; height: 30px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--bg-blur); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
  }
  .tabbar a, .tabbar button { flex: 1; display: grid; place-items: center; height: 54px; }
  .tabbar .ico { position: relative; width: 26px; height: 26px; }
  .tabbar .on .ico svg { stroke-width: 2.6; }
  .fab {
    display: grid; place-items: center; position: fixed; z-index: 55;
    right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }
  .fab .ico { width: 26px; height: 26px; }
  .fab .ico svg { stroke-width: 2.6; }
  .overlay { padding: 0; align-items: flex-start; }
  .dialog { max-width: none; min-height: 100%; border-radius: 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); padding-top: env(safe-area-inset-top, 0px); }
  .picker-pop { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--bg); }
  emoji-picker { width: 100%; height: 360px; --num-columns: 8; }
  .body { font-size: 22px; }
  .body.jumbo { font-size: 42px; }
  .quick { display: none; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .new-pill { top: 112px; }
  .banner { height: 120px; }
  .profile-top { margin-top: -40px; }
  .profile-top .avatar { --s: 84px !important; }
  .profile-actions { margin-top: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- ひろめる・⋯メニュー ---------- */
.post-ctx { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: -2px 0 -6px 26px; font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.post-ctx .ico { width: 16px; height: 16px; }
.post-ctx a:hover { text-decoration: underline; }
.act.boost.on { color: #1f9d55; }
.act.boost:hover { color: #1f9d55; }
.act.boost:hover .ico { background: color-mix(in srgb, #1f9d55 14%, transparent); }
.menu-pop button { display: flex; align-items: center; gap: 12px; }
.menu-pop button .ico { width: 19px; height: 19px; flex: none; }
.menu-pop button.danger { color: var(--danger); }
.menu-pop .emo-text { font-family: var(--font); }
.menu-reacts { display: flex; align-items: center; gap: 2px; padding: 4px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop .menu-reacts button { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 10px; font-size: 22px; }
.menu-pop .menu-reacts button:hover { background: var(--accent-soft); }
.menu-pop .menu-reacts .more-react { color: var(--accent-text); }
.menu-pop .menu-reacts .more-react svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 通報・運営 ---------- */
.report-target { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.report-target .post { border: 0; padding-bottom: 10px; }
.reasons { display: grid; gap: 6px; }
.reason { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; }
.reason:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.reason input { accent-color: var(--accent-text); width: 18px; height: 18px; margin: 0; }
.link { color: var(--accent-text); font-weight: 700; }
.link:hover { text-decoration: underline; }
.link-danger { color: var(--danger); font-weight: 700; font-size: 14px; justify-self: center; padding: 6px; }
.link-danger:hover { text-decoration: underline; }
.consent { margin: -6px 0 0; font-size: 12px; color: var(--fg-muted); text-align: center; }
.consent a { color: var(--accent-text); font-weight: 700; }
.report { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px 0; font-size: 13px; }
.report-meta strong { color: var(--danger); }
.report .post { border-bottom: 0; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 0 68px; }
.report-done { padding: 16px; color: var(--fg-muted); font-weight: 700; }

/* ---------- このサイトについて ---------- */
.about { padding: 8px 20px 40px; max-width: 64ch; }
.about-sec { scroll-margin-top: 70px; }
.about h2 { font-size: 19px; font-weight: 800; margin: 26px 0 8px; }
.about p, .about li { color: var(--fg); line-height: 1.85; }
.about ul { padding-left: 1.2em; margin: 0; }
.about li { margin: 4px 0; }
.side-foot p { margin: 0 0 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.foot-links a, .foot-links button { font-size: 12px; color: var(--fg-muted); }
.foot-links a:hover, .foot-links button:hover { text-decoration: underline; color: var(--fg); }

/* ---------- スタンプの絵 ---------- */
.art {
  position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; border-radius: 16px;
  container-type: inline-size; isolation: isolate; user-select: none; -webkit-user-select: none;
}
.stamp {
  position: absolute; font-family: var(--emoji); line-height: 1; white-space: nowrap;
  pointer-events: none; transform-origin: 50% 50%;
}
.post-content .body + .post-art { margin-top: 6px; }
.post-art { margin: 8px 0 4px; max-width: 420px; }
.post-art .art { border: 1px solid var(--line); }
.post.detail .post-art { max-width: 520px; }
.compose-art { position: relative; width: 132px; margin: 6px 0 2px; }
.compose-art-thumb { display: block; width: 100%; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
.compose-art-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; background: rgba(22, 20, 15, 0.7); color: #fff; }
.compose-art-x:hover { background: rgba(22, 20, 15, 0.85); }
.compose-art-x svg { width: 16px; height: 16px; }

/* 編集画面 */
.dialog-wide { max-width: 920px; }
.art-editor { display: grid; gap: 12px; }
.ae-top { display: flex; align-items: center; gap: 2px; }
.ae-top .icon-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.ae-spacer { flex: 1; }
.ae-count { font-size: 12px; color: var(--fg-muted); margin-left: 8px; }
.ae-main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.ae-stage-box { position: relative; container-type: inline-size; touch-action: none; }
.ae-stage { border-radius: 18px; box-shadow: 0 0 0 1px var(--line); touch-action: none; outline: none; cursor: default; }
.ae-stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ae-stage .stamp { pointer-events: auto; cursor: grab; }
.ae-stage .stamp:active { cursor: grabbing; }
.ae-tip { position: absolute; left: 0; right: 0; top: 46%; text-align: center; color: var(--fg-muted); font-weight: 700; pointer-events: none; padding: 0 24px; }
.ae-sel { position: absolute; border: 2px dashed var(--accent-text); border-radius: 10px; pointer-events: none; z-index: 2; }
.ae-h {
  position: absolute; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22); pointer-events: auto; touch-action: none;
}
.ae-h svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ae-del { top: -15px; left: -15px; color: var(--danger); }
.ae-rot { bottom: -15px; right: -15px; color: var(--accent-text); cursor: nwse-resize; }
.ae-panel { display: grid; gap: 10px; min-width: 0; }
.ae-tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 12px; }
.ae-tab { flex: 1; height: 36px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--fg-muted); }
.ae-tab.on { background: var(--bg); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ae-pane { display: none; }
.ae-panel[data-tab="add"] [data-pane="add"], .ae-panel[data-tab="edit"] [data-pane="edit"],
.ae-panel[data-tab="layers"] [data-pane="layers"], .ae-panel[data-tab="bg"] [data-pane="bg"] { display: grid; gap: 8px; }
.ae-label { font-size: 12px; font-weight: 800; color: var(--fg-muted); letter-spacing: 0.03em; }
.ae-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 300px; overflow-y: auto; }
.ae-grid.recent { max-height: none; min-height: 38px; }
.ae-stamp { aspect-ratio: 1; border-radius: 10px; font-family: var(--emoji); font-size: 24px; line-height: 1; }
.ae-stamp:hover { background: var(--accent-soft); }
.ae-stamp:active { transform: scale(0.9); }
.ae-more .ico { width: 20px; height: 20px; }
.ae-empty { grid-column: 1 / -1; color: var(--fg-muted); font-size: 13px; padding: 8px 2px; list-style: none; }
.ae-edit { display: grid; gap: 10px; }
.ae-slider { display: grid; grid-template-columns: 56px 1fr 46px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.ae-slider input { width: 100%; accent-color: var(--accent-text); }
.ae-slider .num { text-align: right; color: var(--fg-muted); }
.ae-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ae-tool { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.ae-tool:hover { background: var(--bg-soft); }
.ae-tool.danger { color: var(--danger); }
.ae-tool-ico { width: 22px; height: 22px; }
.ae-tool-ico svg, .ae-layer svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ae-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.ae-layer { display: grid; grid-template-columns: 40px 1fr auto auto auto; align-items: center; gap: 4px; padding: 3px 4px 3px 6px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.ae-layer:hover { background: var(--bg-soft); }
.ae-layer.on { border-color: var(--accent); background: var(--accent-soft); }
.ae-layer.drop { box-shadow: 0 -3px 0 var(--accent-text); }
.ae-layer-emo { font-family: var(--emoji); font-size: 26px; line-height: 1; text-align: center; display: inline-block; }
.ae-layer-name { font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.ae-layer .icon-btn { width: 32px; height: 32px; }
.ae-layer .icon-btn svg { width: 17px; height: 17px; }
.ae-layer .icon-btn:disabled { opacity: 0.25; }
.ae-layer .icon-btn.danger { color: var(--danger); }
.ae-swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.ae-swatch { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.ae-swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-text); }
.ae-clear { justify-self: start; margin-top: 8px; }

/* ---------- オープン（チャット） ---------- */
body.chat-on .column { padding-bottom: 0; }
body.chat-on .fab { display: none !important; }
.chat-view { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-view .col-head { position: relative; }
.chat-body { position: relative; flex: 1; min-height: 0; }
.chat-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none;
  display: flex; flex-direction: column; padding: 4px 0 14px;
}
.chat-top { margin-top: auto; display: grid; place-items: center; min-height: 52px; padding: 8px 16px; }
.chat-start { font-size: 12px; color: var(--fg-muted); }
.chat-log { display: flex; flex-direction: column; padding: 0 14px; }
.chat-day {
  align-self: center; margin: 16px 0 6px; padding: 3px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--fg-muted); font-size: 12px; font-weight: 700;
}
.msg { display: flex; align-items: flex-start; gap: 8px; margin-top: 3px; }
.msg.g-first { margin-top: 12px; }
.chat-day + .msg { margin-top: 6px; }
.msg.mine { justify-content: flex-end; }
.msg > .avatar { visibility: hidden; margin-top: 2px; }
.msg.g-first > .avatar { visibility: visible; }
.msg-stack { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(80%, 440px); }
.msg.mine .msg-stack { align-items: flex-end; }
.msg-line { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.msg.mine .msg-line { flex-direction: row-reverse; }
.bubble {
  font-family: var(--emoji); font-size: 21px; line-height: 1.42; padding: 6px 13px; border-radius: 20px;
  background: var(--bg-soft); color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; min-width: 0;
  transition: filter 0.12s;
}
.bubble.big { font-size: 34px; line-height: 1.18; padding: 6px 12px; }
.bubble.has-art { padding: 5px; width: 230px; }
.bubble.has-art .art { border-radius: 15px; }
.bubble.has-art .bubble-text { display: block; padding: 4px 8px 2px; font-size: 22px; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); }
.msg.other.g-first .bubble { border-top-left-radius: 6px; }
.msg.mine.g-first .bubble { border-top-right-radius: 6px; }
.bubble:hover { filter: brightness(0.97); }
.bubble:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.msg-time { font-size: 11px; color: var(--fg-muted); white-space: nowrap; flex: none; visibility: hidden; padding-bottom: 2px; }
.msg.g-last .msg-time { visibility: visible; }
.msg .reacts { margin-top: 4px; gap: 4px; }
.msg .chip { height: 24px; padding: 0 8px 0 6px; font-size: 12px; }
.msg .chip .emo { font-size: 14px; }
.msg-replies { font-size: 12px; font-weight: 700; color: var(--accent-text); margin-top: 3px; }
.msg-replies:hover { text-decoration: underline; }
.msg-reply-to { font-size: 12px; color: var(--fg-muted); margin: 0 4px 2px; }
.msg-reply-to:hover { text-decoration: underline; }
.msg.fresh .bubble { animation: msg-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(0.94); } }
.chat-pill {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5;
  padding: 8px 16px; border-radius: 999px; background: var(--fg); color: var(--bg);
  font-weight: 800; font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.chat-bar { border-top: 1px solid var(--line); background: var(--bg); padding: 8px 12px 10px; }
.chat-row { display: flex; align-items: flex-end; gap: 4px; }
.chat-row > .icon-btn { margin-bottom: 2px; }
.chat-field {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; margin-left: 4px;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: 22px; padding: 0 14px;
}
.chat-field:focus-within { border-color: var(--accent); background: var(--bg); }
.chat-input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--fg);
  font-family: var(--emoji); font-size: 20px; line-height: 1.4; padding: 7px 0; max-height: 132px;
}
.chat-input::placeholder { font-family: var(--font); font-size: 15px; color: var(--fg-muted); }
.chat-count { font-size: 12px; color: var(--fg-muted); padding: 0 0 11px 6px; }
.chat-count.over { color: var(--danger); font-weight: 800; }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; flex: none; margin-left: 4px;
}
.chat-send:disabled { opacity: 0.35; }
.chat-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chat-bar .hint { padding-left: 84px; }
.chat-attach { display: flex; align-items: center; gap: 10px; padding: 0 0 8px 84px; }
.attach-thumb { width: 64px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.attach-thumb .art { border-radius: 12px; }
.attach-label { font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.chat-bar.guest { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--fg-muted); font-size: 14px; padding: 12px 16px; }
.chat-guest-actions { display: flex; gap: 8px; }

@media (max-width: 800px) {
  .ae-main { grid-template-columns: 1fr; gap: 12px; }
  .ae-stage-wrap { max-width: 440px; width: 100%; justify-self: center; }
}
@media (max-width: 640px) {
  .chat-view { height: calc(100vh - 55px); height: calc(100dvh - 55px - env(safe-area-inset-bottom, 0px)); }
  .chat-log { padding: 0 max(10px, env(safe-area-inset-left, 0px)); }
  .chat-bar { padding: 6px 8px 8px; }
  .chat-bar .hint, .chat-attach { padding-left: 8px; }
  .chat-bar.guest { justify-content: center; text-align: center; }
  .msg-stack { max-width: 82%; }
  .bubble { font-size: 20px; }
  .bubble.big { font-size: 32px; }
  .bubble.has-art { width: 200px; }
  .menu-pop.sheet {
    left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 18px 18px 0 0; min-width: 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); animation: rise 0.18s ease-out;
  }
  .menu-pop.sheet button { padding: 14px 20px; font-size: 16px; }
  .menu-pop.sheet .menu-reacts { justify-content: space-between; padding: 10px 14px; }
  .menu-pop.sheet .menu-reacts button { width: 40px; height: 40px; padding: 0; font-size: 24px; }
  .dialog:has(.art-editor) { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dialog:has(.art-editor) .dialog-head { flex: none; height: 48px; }
  .art-editor { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 6px; }
  .ae-main { min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
  .ae-stage-wrap { max-width: min(440px, calc(100dvh - 360px)); align-self: start; }
  .ae-panel { min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  .ae-panel .ae-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding-bottom: 12px; }
  .ae-grid, .ae-layers { max-height: none; overflow: visible; }
  .report-actions { padding-left: 16px; }
}

.sheet-dim { position: fixed; inset: 0; z-index: 119; background: var(--overlay); animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
