/* JiCHO alerts (1 Nov 2026): account-restriction warnings and notification indicators.
   Loaded last so it wins over older stylesheets. Presentation only: nothing here changes what
   the server enforces (phone-number sharing is still refused and counted in server/contact-filter.js).

   1. Account restriction warnings: red text, red warning icon, light red panel. Used on the sign-in
      form (#authMessage.jc-restrict) and as the warning bubble in chats (.chat-warning).
   2. Unread counts: one red badge with a white number everywhere (Inbox, Cockpit, WALL bell,
      Messenger chats and tabs). Muted chats keep their quiet badge.
   3. Unread vs read notifications: unread rows have a red left bar, a tinted background, bold text
      and a red dot; read rows are plain and lighter. */
:root{--jc-alert:#dc2626;--jc-alert-ink:#b91c1c;--jc-alert-bg:#fef2f2;--jc-alert-line:#fca5a5}

/* ---- 1. Restriction warnings ---- */
.jc-restrict,#authMessage.jc-restrict{display:flex;align-items:flex-start;gap:10px;margin:12px 0 0;padding:12px 14px;border:1.5px solid var(--jc-alert-line);border-radius:14px;background:var(--jc-alert-bg);color:var(--jc-alert-ink)!important;font-size:14px;line-height:1.45;font-weight:800;text-align:left}
.jc-restrict-icon{flex:0 0 22px;width:22px;height:22px;color:var(--jc-alert);margin-top:1px}
.jc-restrict-icon svg{display:block;width:100%;height:100%}
.jc-restrict-text{flex:1;min-width:0}
#chatView .bubble.chat-warning,.bubble.chat-warning{display:flex;align-items:flex-start;gap:9px;color:var(--jc-alert-ink)!important;background:var(--jc-alert-bg)!important;border:1.5px solid var(--jc-alert-line)!important;font-weight:800;text-align:left}
.bubble.chat-warning::before{content:"";flex:0 0 20px;width:20px;height:20px;margin-top:1px;background:var(--jc-alert);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1.5 21h21L12 2.5Zm-1.2 7h2.4v6h-2.4v-6Zm0 7.6h2.4v2.4h-2.4v-2.4Z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1.5 21h21L12 2.5Zm-1.2 7h2.4v6h-2.4v-6Zm0 7.6h2.4v2.4h-2.4v-2.4Z'/%3E%3C/svg%3E") center/contain no-repeat}
.toast.notice-tone-restrict{border-left:5px solid var(--jc-alert)!important;background:var(--jc-alert-bg)!important;color:var(--jc-alert-ink)!important}
.toast.notice-tone-restrict strong{color:var(--jc-alert-ink)!important}

/* ---- 2. Red unread badges ---- */
#inboxBadge:not(:empty),#wallBellBadge:not([hidden]),.jcp-badge,.mx-badge:not(.muted),.mx-tab:not(.active) .mx-count,.jc-count{background:var(--jc-alert)!important;color:#fff!important;font-weight:900;border-radius:999px;box-shadow:0 0 0 2px #fff}
#wallBellBadge{display:inline-block;min-width:18px;height:18px;line-height:18px;padding:0 5px;font-size:10.5px;text-align:center;font-style:normal}
#wallBellBadge[hidden]{display:none!important}
.mx-tab.active .mx-count{color:var(--jc-alert)!important}

/* ---- 3. Unread vs read ----
   #threadList raises specificity above controls.css, which the inbox loads after this file. */
#chatView #threadList .thread.unread,#chatView #threadList .thread[data-chat-tone].unread,#chatView #threadList .ibx-note.unread{background:#fff5f5!important;box-shadow:inset 4px 0 0 var(--jc-alert)!important}
#chatView #threadList .thread.active.unread{background:#ffecec!important}
#chatView #threadList .thread.unread .thread-text strong{color:#111827!important;font-weight:900!important}
#chatView #threadList .thread.unread .thread-text small{color:#374151!important;font-weight:700!important}
#chatView #threadList .thread .thread-unread,.thread-unread{background:var(--jc-alert)!important;width:9px!important;height:9px!important;border-radius:50%;flex:0 0 9px;box-shadow:0 0 0 2px #fff}
#chatView #threadList .thread.read,#chatView #threadList .ibx-note.read{background:#fff!important;box-shadow:none!important}
#chatView #threadList .thread.read .thread-text strong{color:#4b5563!important;font-weight:600!important}
#chatView #threadList .thread.read .thread-text small{color:#9ca3af!important;font-weight:400!important}
.mx-row.unread{background:#fff5f5;box-shadow:inset 4px 0 0 var(--jc-alert)}
.mx-row.unread .mx-row-time{color:var(--jc-alert-ink)!important}
.mx-row.unread .mx-row-name{font-weight:900}
/* JiCHO alerts (1 Nov 2026): account-restriction warnings and notification indicators.
   Loaded last so it wins over older stylesheets. Presentation only: nothing here changes what
   the server enforces (phone-number sharing is still refused and counted in server/contact-filter.js).

   1. Account restriction warnings: red text, red warning icon, light red panel. Used on the sign-in
      form (#authMessage.jc-restrict) and as the warning bubble in chats (.chat-warning).
   2. Unread counts: one red badge with a white number everywhere (Inbox, Cockpit, WALL bell,
      Messenger chats and tabs). Muted chats keep their quiet badge.
   3. Unread vs read notifications: unread rows have a red left bar, a tinted background, bold text
      and a red dot; read rows are plain and lighter. */
:root{--jc-alert:#dc2626;--jc-alert-ink:#b91c1c;--jc-alert-bg:#fef2f2;--jc-alert-line:#fca5a5}

/* ---- 1. Restriction warnings ---- */
.jc-restrict,#authMessage.jc-restrict{display:flex;align-items:flex-start;gap:10px;margin:12px 0 0;padding:12px 14px;border:1.5px solid var(--jc-alert-line);border-radius:14px;background:var(--jc-alert-bg);color:var(--jc-alert-ink)!important;font-size:14px;line-height:1.45;font-weight:800;text-align:left}
.jc-restrict-icon{flex:0 0 22px;width:22px;height:22px;color:var(--jc-alert);margin-top:1px}
.jc-restrict-icon svg{display:block;width:100%;height:100%}
.jc-restrict-text{flex:1;min-width:0}
#chatView .bubble.chat-warning,.bubble.chat-warning{display:flex;align-items:flex-start;gap:9px;color:var(--jc-alert-ink)!important;background:var(--jc-alert-bg)!important;border:1.5px solid var(--jc-alert-line)!important;font-weight:800;text-align:left}
.bubble.chat-warning::before{content:"";flex:0 0 20px;width:20px;height:20px;margin-top:1px;background:var(--jc-alert);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1.5 21h21L12 2.5Zm-1.2 7h2.4v6h-2.4v-6Zm0 7.6h2.4v2.4h-2.4v-2.4Z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1.5 21h21L12 2.5Zm-1.2 7h2.4v6h-2.4v-6Zm0 7.6h2.4v2.4h-2.4v-2.4Z'/%3E%3C/svg%3E") center/contain no-repeat}
.toast.notice-tone-restrict{border-left:5px solid var(--jc-alert)!important;background:var(--jc-alert-bg)!important;color:var(--jc-alert-ink)!important}
.toast.notice-tone-restrict strong{color:var(--jc-alert-ink)!important}

/* ---- 2. Red unread badges ---- */
#inboxBadge:not(:empty),#wallBellBadge:not([hidden]),.jcp-badge,.mx-badge:not(.muted),.mx-tab:not(.active) .mx-count,.jc-count{background:var(--jc-alert)!important;color:#fff!important;font-weight:900;border-radius:999px;box-shadow:0 0 0 2px #fff}
#wallBellBadge{display:inline-block;min-width:18px;height:18px;line-height:18px;padding:0 5px;font-size:10.5px;text-align:center;font-style:normal}
#wallBellBadge[hidden]{display:none!important}
.mx-tab.active .mx-count{color:var(--jc-alert)!important}

/* ---- 3. Unread vs read ----
   #threadList raises specificity above controls.css, which the inbox loads after this file. */
#chatView #threadList .thread.unread,#chatView #threadList .thread[data-chat-tone].unread,#chatView #threadList .ibx-note.unread{background:#fff5f5!important;box-shadow:inset 4px 0 0 var(--jc-alert)!important}
#chatView #threadList .thread.active.unread{background:#ffecec!important}
#chatView #threadList .thread.unread .thread-text strong{color:#111827!important;font-weight:900!important}
#chatView #threadList .thread.unread .thread-text small{color:#374151!important;font-weight:700!important}
#chatView #threadList .thread .thread-unread,.thread-unread{background:var(--jc-alert)!important;width:9px!important;height:9px!important;border-radius:50%;flex:0 0 9px;box-shadow:0 0 0 2px #fff}
#chatView #threadList .thread.read,#chatView #threadList .ibx-note.read{background:#fff!important;box-shadow:none!important}
#chatView #threadList .thread.read .thread-text strong{color:#4b5563!important;font-weight:600!important}
#chatView #threadList .thread.read .thread-text small{color:#9ca3af!important;font-weight:400!important}
.mx-row.unread{background:#fff5f5;box-shadow:inset 4px 0 0 var(--jc-alert)}
.mx-row.unread .mx-row-time{color:var(--jc-alert-ink)!important}
.mx-row.unread .mx-row-name{font-weight:900}
/* A blocked account's details inside the restriction box (public/index.html showRestriction). */
.jc-barred{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:10px 0 0;font-weight:600}
.jc-barred dt{font-weight:900;white-space:nowrap}
.jc-barred dd{margin:0}
@media (max-width:480px){.jc-barred{grid-template-columns:1fr;gap:2px}.jc-barred dd{margin-bottom:6px}}
