﻿.direct-chat-profile-target{cursor:pointer}
.message-meta.direct-chat-profile-target{text-decoration:underline dotted;text-underline-offset:2px}
.direct-chat-profile-target:focus-visible{outline:2px solid #60a5fa;outline-offset:3px}

.direct-chat-backdrop{
  position:fixed;
  inset:0;
  z-index:2147482000;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  padding:16px;
  background:rgba(2,6,23,.72);
  opacity:0;
  backdrop-filter:blur(0);
  transition:opacity .18s ease,backdrop-filter .18s ease;
}
.direct-chat-backdrop.open{opacity:1;backdrop-filter:blur(4px)}
.direct-chat-backdrop.closing{opacity:0;backdrop-filter:blur(0)}
.direct-chat-card{
  box-sizing:border-box;
  width:min(100%,400px);
  max-height:min(86dvh,680px);
  overflow:auto;
  border:1px solid #475569;
  border-radius:18px;
  background:#111827;
  color:#f8fafc;
  -webkit-text-fill-color:currentColor;
  box-shadow:0 24px 70px rgba(0,0,0,.48);
  opacity:0;
  transform:translateY(14px) scale(.96);
  transition:opacity .2s ease,transform .2s cubic-bezier(.2,.85,.2,1);
}
.direct-chat-backdrop.open .direct-chat-card{opacity:1;transform:translateY(0) scale(1)}
.direct-chat-backdrop.closing .direct-chat-card{opacity:0;transform:translateY(8px) scale(.98)}
.direct-chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px 10px;
  border-bottom:1px solid rgba(148,163,184,.24);
}
.direct-chat-title{margin:0;font-size:17px;line-height:1.35;font-weight:900}
.direct-chat-close{
  flex:0 0 36px;
  width:36px;
  height:36px;
  padding:0!important;
  border:1px solid #64748b!important;
  border-radius:10px!important;
  background:#1e293b!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:24px!important;
  line-height:1!important;
}
.direct-chat-body{padding:18px 18px 8px}
.direct-chat-profile,.direct-chat-result{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  text-align:center;
}
.direct-chat-avatar{
  display:grid;
  place-items:center;
  width:88px;
  height:88px;
  overflow:hidden;
  border:3px solid #60a5fa;
  border-radius:50%;
  background:linear-gradient(145deg,#334155,#0f172a);
  color:#fff;
  -webkit-text-fill-color:#fff;
  font-size:32px;
  font-weight:950;
  box-shadow:0 8px 24px rgba(15,23,42,.34);
}
.direct-chat-avatar img{width:100%;height:100%;object-fit:cover}
.direct-chat-presence-avatar{
  border-color:transparent!important;
  box-shadow:none!important;
  transition:border-color .18s ease,box-shadow .18s ease,filter .18s ease;
}
.direct-chat-presence-avatar.direct-chat-user-offline{
  border-color:#8b949e!important;
  box-shadow:0 0 0 1px rgba(139,148,158,.42)!important;
  filter:saturate(.72);
}
.direct-chat-profile-name{max-width:100%;overflow-wrap:anywhere;font-size:20px;font-weight:950}
.direct-chat-profile-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:stretch;
  gap:8px;
  width:100%;
  margin-top:1px;
}
.direct-chat-profile .direct-chat-profile-actions .direct-chat-button{
  width:100%;
  min-width:0;
  min-height:46px;
  padding:7px 7px!important;
  font-size:11.5px!important;
  line-height:1.35;
  white-space:normal;
}
.direct-chat-profile .direct-chat-profile-actions .profile-chat{min-width:0;margin-top:0}
.direct-chat-profile-actions>.direct-chat-button:only-child{
  grid-column:1/-1;
  justify-self:center;
  width:min(100%,220px);
}
.direct-chat-button.profile-hide-chat{
  border-color:#b45309!important;
  background:#422006!important;
  color:#ffedd5!important;
  -webkit-text-fill-color:#ffedd5!important;
}
.direct-chat-button.profile-hide-chat.is-active{
  border-color:#dc2626!important;
  background:#7f1d1d!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
.direct-chat-note{
  margin:0;
  color:#cbd5e1;
  -webkit-text-fill-color:currentColor;
  font-size:12px;
  line-height:1.55;
}
.direct-chat-result>p{margin:0;font-size:15px;line-height:1.65;font-weight:750}
.direct-chat-invite-message{font-size:16px!important;font-weight:900!important}
.direct-chat-actions{display:flex;justify-content:flex-end;gap:9px;padding:14px 18px 18px}
.direct-chat-button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box;
  min-height:43px;
  padding:8px 15px!important;
  border:1px solid #64748b!important;
  border-radius:12px!important;
  background:#1e293b!important;
  color:#f8fafc!important;
  -webkit-text-fill-color:#f8fafc!important;
  text-decoration:none!important;
  font:inherit;
  font-size:14px!important;
  font-weight:900!important;
  cursor:pointer;
}
.direct-chat-button.primary{
  border-color:#2563eb!important;
  background:#2563eb!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
.direct-chat-button:disabled{cursor:default;opacity:.48}

/* 個別チャットのおさそい — 入力欄左の条件付きタスク */
main .inputrow > .direct-chat-invite-task{
  position:relative!important;
  flex:0 0 42px!important;
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  padding:0!important;
  display:inline-grid!important;
  place-items:center!important;
  overflow:visible!important;
  border:1px solid rgba(255,255,255,.14)!important;
  border-radius:15px!important;
  background:linear-gradient(180deg,rgba(37,99,235,.96),rgba(29,78,216,.96))!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  box-shadow:0 4px 14px rgba(29,78,216,.24)!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:transparent;
  z-index:3;
}
main .inputrow > .direct-chat-invite-task[hidden]{display:none!important}
main .inputrow > .direct-chat-invite-task::before,
main .inputrow > .direct-chat-invite-task::after{content:none!important;display:none!important}
main .inputrow > .direct-chat-invite-task:hover,
main .inputrow > .direct-chat-invite-task.is-open{
  border-color:rgba(191,219,254,.8)!important;
  background:linear-gradient(180deg,#3b82f6,#2563eb)!important;
}
main .inputrow > .direct-chat-invite-task:active{transform:translateY(1px) scale(.985)}
.direct-chat-invite-task-icon{
  display:block;
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.direct-chat-invite-task-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border:2px solid #101525;
  border-radius:999px;
  background:#dc2626;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:10px;
  font-weight:950;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
main .inputrow > .direct-chat-invite-task.has-new{
  animation:directChatInviteTaskArrive .64s cubic-bezier(.2,.85,.2,1) both;
}
@keyframes directChatInviteTaskArrive{
  0%{opacity:.2;transform:translateY(6px) scale(.78)}
  58%{opacity:1;transform:translateY(-2px) scale(1.08)}
  100%{opacity:1;transform:translateY(0) scale(1)}
}

.direct-chat-invite-list-panel{
  position:fixed;
  z-index:2147481900;
  box-sizing:border-box;
  max-height:min(58dvh,470px);
  overflow:hidden;
  border:1px solid #475569;
  border-radius:17px;
  background:#111827;
  color:#f8fafc;
  -webkit-text-fill-color:currentColor;
  box-shadow:0 18px 48px rgba(0,0,0,.38);
  animation:directChatInviteListIn .16s cubic-bezier(.2,.85,.2,1) both;
}
.direct-chat-invite-list-panel[hidden]{display:none!important}
@keyframes directChatInviteListIn{
  from{opacity:0;transform:translateY(7px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.direct-chat-invite-list-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 13px;
  border-bottom:1px solid rgba(148,163,184,.24);
}
.direct-chat-invite-list-title{font-size:14px;font-weight:950;line-height:1.35}
.direct-chat-invite-list-count{margin-top:2px;color:#cbd5e1;font-size:10px;font-weight:750}
.direct-chat-invite-list-close{
  flex:0 0 32px!important;
  width:32px!important;
  height:32px!important;
  min-height:32px!important;
  padding:0!important;
  border:1px solid #64748b!important;
  border-radius:9px!important;
  background:#1e293b!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:21px!important;
  line-height:1!important;
}
.direct-chat-invite-list{
  max-height:calc(min(58dvh,470px) - 58px);
  overflow:auto;
  overscroll-behavior:contain;
}
.direct-chat-invite-list-row{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:11px 13px;
  border-bottom:1px solid rgba(148,163,184,.18);
}
.direct-chat-invite-list-row:last-child{border-bottom:0}
.direct-chat-invite-list-avatar{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  overflow:hidden;
  border:2px solid #60a5fa;
  border-radius:50%;
  background:#334155;
  color:#fff;
  -webkit-text-fill-color:#fff;
  font-size:15px;
  font-weight:950;
}
.direct-chat-invite-list-avatar img{width:100%;height:100%;object-fit:cover}
.direct-chat-invite-list-info{min-width:0}
.direct-chat-invite-list-name{
  overflow:hidden;
  color:#f8fafc;
  -webkit-text-fill-color:#f8fafc;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
  font-weight:950;
}
.direct-chat-invite-list-description{margin-top:2px;color:#e2e8f0;font-size:11px;line-height:1.35}
.direct-chat-invite-list-remaining{margin-top:3px;color:#93c5fd;font-size:10px;font-weight:850;font-variant-numeric:tabular-nums}
.direct-chat-invite-list-actions{display:flex;gap:6px}
.direct-chat-button.compact{min-height:34px;padding:5px 10px!important;font-size:11px!important}

body.local-light main .inputrow > .direct-chat-invite-task{
  border-color:#1d4ed8!important;
  background:linear-gradient(180deg,#3b82f6,#2563eb)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  box-shadow:0 4px 12px rgba(37,99,235,.2)!important;
}
body.local-light .direct-chat-invite-task-badge{border-color:#fff}
body.local-light .direct-chat-invite-list-panel{
  border-color:#94a3b8;
  background:#fff;
  color:#0f172a;
  -webkit-text-fill-color:currentColor;
  box-shadow:0 18px 48px rgba(15,23,42,.22);
}
body.local-light .direct-chat-invite-list-head{border-bottom-color:#dbe2ea}
body.local-light .direct-chat-invite-list-count{color:#475569}
body.local-light .direct-chat-invite-list-close{
  border-color:#334155!important;
  background:#fff!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
}
body.local-light .direct-chat-invite-list-row{border-bottom-color:#dbe2ea}
body.local-light .direct-chat-invite-list-avatar{border-color:#2563eb;background:#e2e8f0;color:#0f172a;-webkit-text-fill-color:#0f172a}
body.local-light .direct-chat-invite-list-name{color:#0f172a;-webkit-text-fill-color:#0f172a}
body.local-light .direct-chat-invite-list-description{color:#334155;-webkit-text-fill-color:#334155}
body.local-light .direct-chat-invite-list-remaining{color:#1d4ed8;-webkit-text-fill-color:#1d4ed8}

body.local-light .direct-chat-backdrop{background:rgba(71,85,105,.48)}
body.local-light .direct-chat-card{
  border-color:#94a3b8;
  background:#fff;
  color:#0f172a;
  -webkit-text-fill-color:currentColor;
  box-shadow:0 24px 70px rgba(15,23,42,.22);
}
body.local-light .direct-chat-head{border-bottom-color:#dbe2ea}
body.local-light .direct-chat-close{
  border-color:#334155!important;
  background:#fff!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
}
body.local-light .direct-chat-avatar{border-color:#2563eb;background:#e2e8f0;color:#0f172a;-webkit-text-fill-color:#0f172a}
body.local-light .direct-chat-presence-avatar{border-color:transparent!important;box-shadow:none!important}
body.local-light .direct-chat-presence-avatar.direct-chat-user-offline{
  border-color:#8b949e!important;
  box-shadow:0 0 0 1px rgba(71,85,105,.32)!important;
}
body.local-light .direct-chat-note{color:#475569!important;-webkit-text-fill-color:#475569!important}
body.local-light .direct-chat-button{
  border-color:#334155!important;
  background:#fff!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
}
body.local-light .direct-chat-button.primary{
  border-color:#2563eb!important;
  background:#2563eb!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
body.local-light .direct-chat-button.profile-hide-chat{
  border-color:#b45309!important;
  background:#fff7ed!important;
  color:#9a3412!important;
  -webkit-text-fill-color:#9a3412!important;
}
body.local-light .direct-chat-button.profile-hide-chat.is-active{
  border-color:#dc2626!important;
  background:#fee2e2!important;
  color:#991b1b!important;
  -webkit-text-fill-color:#991b1b!important;
}

/* 端末内で「今日だけ非表示」にしたユーザーの発言。
   mobile の .message.with-avatar display:flex!important より詳細度を上げる。 */
html body main #chatlog [data-sender-client-id].for314-user-chat-hidden-today,
html body main .chatlog [data-sender-client-id].for314-user-chat-hidden-today{
  display:none!important;
  visibility:hidden!important;
}

@media(max-width:430px){
  .direct-chat-backdrop{padding:12px}
  .direct-chat-card{border-radius:15px}
  .direct-chat-title{font-size:15px}
  .direct-chat-body{padding:15px 14px 7px}
  .direct-chat-actions{padding:12px 14px 15px}
  .direct-chat-invite-list-row{grid-template-columns:38px minmax(0,1fr);gap:8px;padding:10px}
  .direct-chat-invite-list-avatar{width:36px;height:36px}
  .direct-chat-invite-list-actions{grid-column:1/-1;justify-content:flex-end}
}
@media(max-width:260px){
  .direct-chat-backdrop{padding:6px}
  .direct-chat-head{padding:8px}
  .direct-chat-title{font-size:12px}
  .direct-chat-close{flex-basis:30px;width:30px;height:30px;font-size:19px!important}
  .direct-chat-body{padding:10px 8px 5px}
  .direct-chat-avatar{width:62px;height:62px;font-size:23px}
  .direct-chat-profile-name{font-size:15px}
  .direct-chat-result>p,.direct-chat-invite-message{font-size:11px!important}
  .direct-chat-note{font-size:9px}
  .direct-chat-actions{display:grid;grid-template-columns:1fr;padding:8px;gap:6px}
  .direct-chat-button{width:100%;min-height:34px;padding:5px 7px!important;font-size:10px!important}
  .direct-chat-profile-actions{grid-template-columns:1fr;gap:6px}
  .direct-chat-profile .profile-chat{min-width:0;width:100%}
  main .inputrow > .direct-chat-invite-task{
    flex-basis:31px!important;width:31px!important;min-width:31px!important;max-width:31px!important;
    height:34px!important;min-height:34px!important;border-radius:9px!important;
  }
  .direct-chat-invite-task-icon{width:15px;height:15px}
  .direct-chat-invite-task-badge{top:-5px;right:-5px;min-width:16px;height:16px;padding:0 3px;border-width:1px;font-size:8px}
  .direct-chat-invite-list-head{padding:8px}
  .direct-chat-invite-list-title{font-size:11px}
  .direct-chat-invite-list-count{font-size:8px}
  .direct-chat-invite-list-close{flex-basis:27px!important;width:27px!important;height:27px!important;min-height:27px!important;font-size:17px!important}
  .direct-chat-invite-list-row{grid-template-columns:30px minmax(0,1fr);gap:6px;padding:7px}
  .direct-chat-invite-list-avatar{width:28px;height:28px;border-width:1px;font-size:11px}
  .direct-chat-invite-list-name{font-size:10px}
  .direct-chat-invite-list-description,.direct-chat-invite-list-remaining{font-size:8px}
  .direct-chat-invite-list-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .direct-chat-button.compact{min-height:29px;padding:3px 5px!important;font-size:9px!important}
}
@media(prefers-reduced-motion:reduce){
  .direct-chat-backdrop,.direct-chat-card{transition:none!important}
  main .inputrow > .direct-chat-invite-task.has-new,
  .direct-chat-invite-list-panel{animation:none!important}
}


/* FOR314 MOBILE ACTIVITY TRAY v1
   個別チャット通知をcomposer幅から外し、通話/YouTubeと入力欄上で並べる */
@media(max-width:680px){
  main .inputrow > .direct-chat-invite-task{
    position:absolute!important;
    left:6px!important;
    right:auto!important;
    top:auto!important;
    bottom:calc(100% + 7px)!important;
    flex:0 0 36px!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:34px!important;
    min-height:34px!important;
    border-radius:12px!important;
    z-index:26!important;
  }
  main .inputrow:has(> .voice-call-minimized-task) > .direct-chat-invite-task{
    left:76px!important;
  }
  .direct-chat-invite-task-icon{width:16px!important;height:16px!important}
  .direct-chat-invite-task-badge{
    top:-5px!important;right:-5px!important;min-width:16px!important;height:16px!important;padding:0 3px!important;border-width:1px!important;font-size:8px!important;
  }
}
