:root {
  --bg: #313338; --side: #2b2d31; --side-2: #1e1f22; --hover: #35373c; --active: #404249;
  --text: #dbdee1; --muted: #949ba4; --strong: #f2f3f5; --accent: #5865f2; --accent-2: #4752c4;
  --link: #00a8fc; --danger: #f23f42; --line: #3f4147; --input: #383a40;
  --side-w: 260px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }

.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------- sidebar ---------- */
.sidebar { width: var(--side-w); flex: none; background: var(--side); display: flex; flex-direction: column; min-height: 0; }
.brand { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 700; color: var(--strong);
  border-bottom: 1px solid var(--side-2); flex: none; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.rooms { flex: 1; overflow-y: auto; padding: 8px; }
.section { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--muted); padding: 16px 8px 4px; }
.rooms ul { list-style: none; margin: 0; padding: 0; }
.rooms li a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--muted); }
.rooms li a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.rooms li a.active { background: var(--active); color: var(--strong); }
.rooms .hash { width: 20px; text-align: center; font-size: 20px; line-height: 1; opacity: .7; }
.rooms .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 通知 badges (Discord-style red pill on the right) */
.rooms li a.unread { color: var(--strong); font-weight: 700; }
.rooms .badge { margin-left: auto; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f23f43;
  color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.menu { position: relative; }
.menu.has-unread::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%;
  background: #f23f43; box-shadow: 0 0 0 2px var(--bg); }
.rooms .empty { color: var(--muted); font-size: 13px; padding: 4px 8px; }
.me { background: var(--side-2); padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); flex: none; }
.me-row { display: flex; align-items: center; gap: 8px; }
.me-names { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.me-names strong { color: var(--strong); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-names span { color: var(--muted); font-size: 12px; }
.me-link { font-size: 18px; padding: 4px 6px; border-radius: 4px; }
.me-link:hover { background: var(--hover); text-decoration: none; }
.login { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--strong); color: #000;
  font-weight: 700; border-radius: 6px; padding: 10px; }
.login:hover { text-decoration: none; opacity: .9; }
.login .x { font-size: 16px; }

/* ---------- avatars ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.xs { width: 20px; height: 20px; font-size: 11px; }

/* ---------- main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-head { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--side-2);
  box-shadow: 0 1px 0 rgba(0,0,0,.2); padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.menu { display: none; background: none; border: 0; font-size: 20px; padding: 4px 8px; margin-left: -8px; color: var(--muted); }
.room-title { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.room-title > span:first-child { color: var(--muted); font-size: 20px; display: inline-flex; }
.room-title strong { color: var(--strong); }
.topic { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; border-left: 1px solid var(--line); }
.online { color: #23a55a; font-size: 13px; flex: none; }

.timeline { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 0 8px; }
.older { display: block; margin: 0 auto 8px; background: var(--side); border: 0; border-radius: 4px; padding: 6px 12px; color: var(--muted); }
.messages { list-style: none; margin: 0; padding: 0; }
.welcome { color: var(--muted); text-align: center; padding: 32px 16px; }
.day { display: flex; align-items: center; margin: 16px 16px 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.day span { padding: 0 8px; }

.msg { position: relative; display: flex; gap: 16px; padding: 4px 48px 4px 16px; margin-top: 12px; }
.msg.grouped { margin-top: 0; padding-top: 1px; padding-bottom: 1px; }
.msg:hover { background: rgba(0,0,0,.08); }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.author { color: var(--strong); font-weight: 600; }
.handle, .msg-head time { color: var(--muted); font-size: 12px; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.gutter-time { width: 40px; flex: none; text-align: center; font-size: 10px; color: var(--muted); visibility: hidden; padding-top: 4px; }
.msg.grouped:hover .gutter-time { visibility: visible; }
/* hover toolbar: 😊＋ (react) / 🗑 (delete) */
.tools { position: absolute; right: 12px; top: -10px; display: flex; background: var(--side); border: 1px solid var(--line); border-radius: 6px;
  opacity: 0; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); z-index: 2; }
@media (hover: hover) { .msg:hover .tools { opacity: 1; pointer-events: auto; } }
.tools:focus-within { opacity: 1; pointer-events: auto; }
.tools .tool { background: none; border: 0; padding: 3px 7px; font-size: 13px; border-radius: 5px; }
.tools .tool:hover { background: var(--hover); }
/* Phones: hidden until the post is tapped (no permanent icons on top of the name / time). */
.tools.touch { top: -18px; right: 8px; }
.tools.touch .tool { padding: 7px 11px; font-size: 17px; }
.msg.tools-open { background: rgba(0,0,0,.12); }
.msg.tools-open .tools { opacity: 1; pointer-events: auto; }

/* reactions under a message */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rchip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent;
  background: var(--side); color: var(--text); font-size: 13px; line-height: 1; }
.rchip:hover:not(:disabled) { border-color: var(--line); }
.rchip:disabled { cursor: default; }
.rchip .re { font-size: 15px; }
.rchip .rn { font-weight: 700; font-size: 12px; }
.rchip.mine { background: rgba(88,101,242,.22); border-color: var(--accent); color: var(--strong); }
.rchip.add { opacity: .6; font-size: 12px; }
.rchip.add:hover { opacity: 1; }
.sys-main { display: flex; flex-direction: column; min-width: 0; }
.rpicker { position: fixed; z-index: 55; display: grid; grid-template-columns: repeat(4, 44px); gap: 2px; padding: 6px; background: var(--side);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: ifade .12s ease; }
.rpicker button { width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; font-size: 24px; }
.rpicker button:hover { background: var(--hover); transform: scale(1.1); }
@keyframes ifade { from { opacity: 0; } }

/* ---------- pinned (personal rooms) ---------- */
.pinned { margin: 0 16px 16px; background: var(--side); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 14px; }
.pinned.empty { color: var(--muted); font-size: 13px; border-left-color: var(--line); }
.pinned-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; }
.pin { color: var(--muted); font-weight: 700; }
.pinned-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--strong); }
.pinned-media { display: grid; gap: 4px; margin-top: 10px; grid-template-columns: repeat(2, 1fr); max-width: 520px; }
.pinned-media.n1 { grid-template-columns: 1fr; }
.pinned-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--side-2); }
.pinned-app { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; }

/* ---------- composer ---------- */
.composer { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0 16px 16px; padding: 6px 6px 6px 14px;
  background: var(--input); border-radius: 8px; margin-bottom: calc(16px + env(safe-area-inset-bottom)); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; /* 16px stops iOS from zooming in */ line-height: 1.4; padding: 6px 0; max-height: 180px; }
.composer textarea::placeholder { color: var(--muted); }
/* "𝕏 でシェア": small chip above the composer for a few seconds after you post */
.share-chip { flex: none; align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; margin: 0 16px 6px; padding: 4px 10px;
  border-radius: 999px; background: var(--side-2); border: 1px solid var(--line); color: var(--strong); font-size: 12px; font-weight: 700;
  animation: ifade .15s ease; }
.share-chip[hidden] { display: none; }
.share-chip:hover { text-decoration: none; background: var(--hover); }
.share-chip .x { font-size: 13px; }
.tools .tool-x { display: inline-flex; align-items: center; color: var(--strong); font-weight: 700; }
.tools .tool-x:hover { text-decoration: none; }
/* 😊＋ is always shown under posts now: keep it small and quiet until hovered */
.reactions .rchip.add { height: 22px; padding: 0 7px; background: transparent; border-color: var(--line); }
.reactions .rchip.add:hover { background: var(--side); }
@media (max-width: 760px) { .share-chip { margin-right: 8px; } }
.composer button { flex: none; width: 36px; height: 36px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 16px; }
.composer button:hover { background: var(--accent-2); }
.composer button:disabled, .composer textarea:disabled { opacity: .5; cursor: not-allowed; }
.composer { padding-left: 6px; }
.composer button.attach { display: grid; place-items: center; background: transparent; color: var(--muted); }
/* Line icons (Lucide style, 24px grid): stroke follows the text color. */
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.composer button.attach:hover:not(:disabled) { background: var(--hover); color: var(--strong); }

/* ---------- 画像の添付: previews above the composer, images in posts, full-screen viewer ---------- */
.attachments { flex: none; display: flex; gap: 8px; margin: 0 16px 6px; overflow-x: auto; }
.att { position: relative; flex: none; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: var(--side); }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att.loading img { opacity: .45; }
.att.failed { outline: 2px solid #f23f43; }
.att-state { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.att-remove { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; font-size: 12px; line-height: 1; }
.msg-images { display: grid; gap: 4px; margin-top: 6px; grid-template-columns: repeat(2, 1fr); max-width: 420px; }
.msg-images.n1 { grid-template-columns: 1fr; max-width: 360px; }
.msg-image { padding: 0; border: 0; background: var(--side-2); border-radius: 8px; overflow: hidden; cursor: zoom-in; display: block; }
.msg-image img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.msg-images.n1 .msg-image img { aspect-ratio: auto; max-height: 360px; object-fit: contain; }
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.92); display: grid; place-items: center; animation: ifade .12s ease; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.viewer-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border: 0;
  border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 32px; }
.viewer-nav.prev { left: 8px; } .viewer-nav.next { right: 8px; }
.viewer-open { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  color: #ddd; font-size: 13px; background: rgba(0,0,0,.5); padding: 6px 12px; border-radius: 6px; }
@media (max-width: 760px) { .attachments { margin-left: 8px; margin-right: 8px; } }

.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--side-2); color: var(--strong); padding: 8px 14px; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.4);
  font-size: 14px; z-index: 30; max-width: calc(100vw - 32px); }

.backdrop { display: none; }

/* ---------- phones: sidebar becomes a drawer ---------- */
@media (max-width: 760px) {
  .menu { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 20; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .app.drawer .sidebar { transform: none; }
  .app.drawer .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10; }
  .room-head { padding-left: 12px; padding-right: 12px; }
  .topic { display: none; }
  .msg { gap: 10px; padding-left: 12px; padding-right: 36px; }
  .avatar { width: 36px; height: 36px; }
  .gutter-time { width: 36px; }
  .pinned { margin-left: 12px; margin-right: 12px; }
  .composer { margin-left: 8px; margin-right: 8px; margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* ---------- system / greeting messages ---------- */
a.brand:hover { text-decoration: none; }
.msg.system { align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.msg.system .sys-icon { width: 40px; flex: none; text-align: center; color: #23a55a; font-weight: 700; font-size: 18px; }
.msg.system .author { color: var(--strong); font-weight: 600; }
.msg.system time { font-size: 12px; }
.tag { font-size: 11px; font-weight: 700; color: #f0b232; background: rgba(240,178,50,.12); border-radius: 4px; padding: 1px 6px; }
.msg.greeting .body { color: var(--strong); }
.greeting-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; font-weight: 600; }

/* ---------- welcome overlay (guests at the lounge top) ----------
   The live #挨拶 stays visible underneath: light veil + slight blur, card on top. */
.welcome-page { position: fixed; inset: 0; z-index: 40; overflow-y: auto; display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(520px 420px at 50% 50%, rgba(30,31,34,.72), rgba(30,31,34,.45)); }
.welcome-card { width: 100%; max-width: 440px; text-align: center; background: rgba(43,45,49,.94); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 24px 20px; box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(88,101,242,.15); }
.hero-mark { display: block; width: 60px; height: 60px; margin: 0 auto; border-radius: 18px; }
.welcome-card h1 { margin: 8px 0 2px; font-size: 24px; color: var(--strong); }
.lead { margin: 0; font-size: 16px; font-weight: 700; color: var(--strong); }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; text-align: left; }
.steps li { display: flex; gap: 12px; align-items: center; }
.steps li div { display: flex; flex-direction: column; line-height: 1.35; }
.steps b { color: var(--strong); font-size: 14px; }
.steps li span:not(.step-no) { color: var(--muted); font-size: 12.5px; }
.step-no { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; }
.cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
.cta-login { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; background: var(--strong); color: #000;
  font-weight: 800; font-size: 16px; border-radius: 999px; padding: 13px 24px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.cta-login:hover { text-decoration: none; filter: brightness(.95); }
.cta-login .x { font-size: 18px; }
.cta-peek { color: var(--muted); font-size: 13px; padding: 4px; }
.tip { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  /* Phones: a bottom sheet, so the chat stays readable above it. */
  .welcome-page { align-items: flex-end; padding: 0; background: linear-gradient(180deg, rgba(30,31,34,.15) 0%, rgba(30,31,34,.7) 100%); }
  .welcome-card { max-width: none; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 22px 20px calc(16px + env(safe-area-inset-bottom)); background: rgba(43,45,49,.97); }
  .hero-mark { display: none; }
  .welcome-card h1 { margin-top: 0; font-size: 21px; }
  .msg.system .sys-icon { width: 36px; }
}


/* 管理人: blue ring on the avatar */
.avatar.admin { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #1d9bf0; }
.avatar.admin.xs { box-shadow: 0 0 0 1.5px var(--side), 0 0 0 3px #1d9bf0; }

/* 📌 pinned bar under the room header */
.pinbar { flex: none; border-bottom: 1px solid var(--side-2); background: linear-gradient(90deg, rgba(240,178,50,.12), rgba(240,178,50,.04)); }
.pinbar-head { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 9px 16px; text-align: left; color: var(--text); font-size: 13.5px; }
.pinbar-icon { flex: none; }
.pinbar-line { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinbar-line b { color: var(--strong); }
.pinbar-more { flex: none; font-size: 12px; color: var(--muted); }
.pinbar-toggle { flex: none; font-size: 12px; font-weight: 700; color: #f0b232; }
.pinbar-body { max-height: 50vh; overflow-y: auto; padding: 0 16px 12px; display: grid; gap: 10px; }
.pinbar-item { background: var(--side); border: 1px solid var(--line); border-left: 3px solid #f0b232; border-radius: 10px; padding: 10px 12px; }
.pinbar-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.pinbar-meta b { color: var(--strong); }
.pinbar-meta time { color: var(--muted); font-size: 12px; }
.pinbar-jump { margin-top: 6px; background: none; border: 0; padding: 0; color: var(--link); font-size: 13px; font-weight: 600; }
.tag.pin { color: #f0b232; }
.msg.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: rgba(240,178,50,.18); } 100% { background: transparent; } }

/* コイン (bottom-left, next to your name) */
.coins { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: #f0b232;
  background: rgba(240,178,50,.1); border-radius: 999px; padding: 3px 9px 3px 5px; }
.coin { width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff3b0 0 12%, #f7c948 30%, #d99a1e 75%); box-shadow: inset 0 0 0 1.5px #b9790f; }

/* sidebar イベント card */
.event-card { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 4px; padding: 10px 12px; border-radius: 10px; color: var(--text);
  background: linear-gradient(135deg, rgba(240,178,50,.18), rgba(88,101,242,.18)); border: 1px solid rgba(240,178,50,.45); }
.event-card:hover { text-decoration: none; border-color: #f0b232; }
.event-label { font-size: 11px; font-weight: 800; color: #f0b232; letter-spacing: .04em; }
.event-card b { color: var(--strong); font-size: 13.5px; line-height: 1.35; }
.event-card small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-go { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--link); }

/* sidebar footer: [avatar + name -> 設定] [coins] [🏠] [⚙] */
.me-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 4px 2px 0;
  border-radius: 6px; text-align: left; }
.me-open:hover { background: var(--hover); }
.me-gear { flex: none; display: grid; place-items: center; width: 32px; height: 32px; background: none; border: 0; border-radius: 6px; color: var(--muted); }
.me-gear:hover { background: var(--hover); color: var(--strong); }
.me-gear .icon { width: 19px; height: 19px; }
/* 設定 */
.set-card { gap: 6px; }
.set-card h4 { margin: 10px 0 2px; font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.set-who { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.set-item { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--side-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; color: var(--strong); text-align: left; }
.set-item:hover { background: var(--hover); }
.set-item .icon { width: 19px; height: 19px; flex: none; color: var(--muted); }
.set-item .icon:last-child { width: 16px; height: 16px; }
.set-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.set-label small { font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-item.danger, .set-item.danger .icon { color: #ff8a8c; }
.set-card .name-actions { margin-top: 10px; }
.name-modal { position: fixed; inset: 0; z-index: 65; background: rgba(10,11,13,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.name-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; background: var(--side); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.name-card b { color: var(--strong); font-size: 16px; }
.name-input { background: var(--dark); border: 1px solid var(--line); border-radius: 8px; color: var(--strong); font-size: 16px; padding: 10px 12px; outline: none; }
.name-input:focus { border-color: var(--accent); }
.name-card small { color: var(--muted); font-size: 12px; }
.name-error { margin: 0; color: var(--danger); font-size: 13px; min-height: 0; }
.name-error:empty { display: none; }
.name-actions { display: flex; justify-content: flex-end; gap: 8px; }
.name-cancel { background: none; border: 0; color: var(--muted); padding: 8px 12px; }
.name-save { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 18px; font-weight: 800; }

/* edited posts */
.edited { color: var(--muted); font-size: 11px; }
.edit-card { max-width: 520px; }
.edit-input { resize: vertical; min-height: 120px; font: inherit; font-size: 15px; line-height: 1.5; }
/* phones: the drawer stays above the dim layer */
.app.drawer .sidebar { z-index: 20; }

/* 管理人 debug panel */
.dbg-card { max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; }
.dbg-card h4 { margin: 8px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.dbg { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dbg td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dbg td:last-child { text-align: right; color: var(--muted); overflow-wrap: anywhere; }
.dbg td.on { color: #23a55a; font-weight: 700; }
.dbg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dbg-btn { background: var(--hover); border: 1px solid var(--line); color: var(--strong); border-radius: 8px; padding: 8px; font-size: 13px; }
.dbg-btn:hover { background: var(--active); }
.dbg-btn.danger { grid-column: 1 / -1; background: rgba(242,63,66,.15); border-color: rgba(242,63,66,.5); color: #ff8a8c; font-weight: 700; }
.dbg-links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }

.dbg-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.dbg-target { background: var(--hover); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.dbg-target.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.dbg-who { font-size: 12px; color: var(--muted); }

/* コンペ: 𝕏 でエントリー */
.entry-btn { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 2px; background: var(--strong); color: #000; border: 0; border-radius: 999px;
  padding: 10px 20px; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.entry-btn .x { font-size: 17px; }
.entry-btn.done { background: var(--hover); color: var(--strong); box-shadow: none; border: 1px solid var(--line); font-size: 13px; padding: 7px 14px; }
.entry-card { max-width: 400px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.entry-preview { background: #000; border: 1px solid #2f3336; border-radius: 14px; padding: 12px; color: #e7e9ea; }
.entry-who { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.entry-who span { color: #71767b; }
.entry-preview p { margin: 6px 0 8px; white-space: pre-wrap; font-size: 14px; }
.entry-preview img { width: 100%; border-radius: 12px; border: 1px solid #2f3336; display: block; }
.entry-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; color: var(--text); }
.entry-steps li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-steps .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.post-chip { background: #1d9bf0; color: #fff; font-weight: 800; border-radius: 999px; padding: 3px 12px; font-size: 13px; box-shadow: 0 0 0 3px rgba(29,155,240,.35); }
.entry-go { width: 100%; background: var(--strong); color: #000; border: 0; border-radius: 999px; padding: 12px; font-weight: 800; font-size: 16px; }
.entry-note { margin: 0; color: var(--text); font-size: 14px; }
.entry-card .name-cancel { align-self: center; }

.entry-go.link { display: block; text-align: center; text-decoration: none; }

/* 今の気持ち (入室): 3 buttons on the guest top page and in the first-login sheet; shown under the join message */
.mood-ask { margin: 14px 0 8px; font-size: 14px; color: var(--strong); font-weight: 700; }
.mood-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 4px; }
.mood-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 14px;
  background: var(--side); border: 1px solid var(--line); color: var(--strong); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mood-btn:hover, .mood-btn:focus-visible { border-color: var(--accent); background: rgba(88,101,242,.18); }
.mood-btn:disabled { opacity: .5; cursor: default; }
.mood-emoji { font-size: 28px; line-height: 1; }
.mood-card { max-width: 420px; text-align: center; }
.sys-mood { margin-top: 2px; font-size: 14px; color: var(--strong); }
.welcome-login-sub { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--muted); }
