.chat-page-header { align-items: flex-start; }
.chat-page-header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.push-controls { display: flex; align-items: center; gap: 8px; }
.push-status { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 10px; border-radius: 6px; background: var(--mint); color: var(--green-dark); font-size: 12px; font-weight: 750; white-space: nowrap; }
.push-status::before { width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); content: ""; }
#enablePush.is-enabled { border-color: #b8d9cb; background: var(--mint-soft); color: var(--green-dark); }
.ops-chat-layout { display: grid; grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); gap: 14px; min-height: 580px; height: calc(100dvh - 150px); }
.notification-inbox, .chat-panel { min-height: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.notification-inbox { overflow: auto; padding: 15px; }
.notification-inbox-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 2px 2px 12px; }
.notification-inbox-head h3 { margin: 0; font-size: 16px; }
.notification-inbox-head span { color: var(--muted); font-size: 12px; }
.text-button { min-height: auto; padding: 3px; border: 0; background: transparent; color: var(--green); font-size: 12px; }
.text-button:hover { background: transparent; color: var(--green-dark); text-decoration: underline; }
.notification-item { width: 100%; min-height: 0; display: grid; gap: 5px; padding: 12px 10px; border: 0; border-top: 1px solid #e7eeea; border-radius: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 400; }
.notification-item:hover { background: var(--mint-soft); }
.notification-item.unread { background: #f3faf7; }
.notification-item strong { font-size: 13px; line-height: 1.4; }
.notification-item span, .notification-item time { color: var(--muted); font-size: 11px; line-height: 1.45; }
.notification-item.critical { border-left: 3px solid var(--coral); }
.notification-item.warning { border-left: 3px solid var(--amber); }
.notification-item.info { border-left: 3px solid var(--green); }
.chat-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; overflow: hidden; }
.chat-messages { display: flex; flex-direction: column; gap: 14px; overflow: auto; padding: 22px; scroll-behavior: smooth; }
.chat-empty { max-width: 360px; margin: auto; padding: 22px; color: var(--muted); text-align: center; line-height: 1.6; }
.chat-empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 17px; }
.chat-empty p { margin: 0; }
.chat-message { max-width: min(80%, 700px); display: grid; gap: 7px; }
.chat-message.user { align-self: flex-end; }
.chat-message.assistant, .chat-message.alert { align-self: flex-start; }
.chat-bubble { padding: 12px 14px; border-radius: 8px; background: var(--mint-soft); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.chat-message.user .chat-bubble { background: var(--green); color: #fff; }
.chat-message.alert .chat-bubble { border-left: 3px solid var(--amber); background: var(--amber-soft); }
.chat-meta { color: var(--muted); font-size: 10px; }
.chat-message.user .chat-meta { text-align: right; }
.chat-action-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chat-action-list button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.chat-quick-actions { display: flex; gap: 7px; overflow-x: auto; padding: 10px 14px 0; border-top: 1px solid #e7eeea; }
.chat-quick-actions button { min-height: 34px; flex: 0 0 auto; padding: 7px 10px; border-color: var(--line); background: var(--paper); color: var(--ink); font-size: 12px; }
.chat-quick-actions button:hover { background: var(--mint-soft); border-color: #bfd9ce; }
.chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 14px 14px; }
.chat-composer textarea { min-height: 44px; max-height: 120px; padding: 11px 12px; resize: none; }
.chat-composer button { min-width: 68px; }
.chat-panel > #chatError { margin: 0; padding: 0 14px 10px; }
.notification-highlight { animation: notification-flash 1.8s ease; }
@keyframes notification-flash { 0%, 100% { background: transparent; } 35% { background: #fff0c8; } }

@media (max-width: 900px) { .ops-chat-layout { grid-template-columns: 1fr; min-height: 0; height: auto; } .notification-inbox { max-height: 260px; } .chat-panel { min-height: 510px; height: calc(100dvh - 255px); } }
@media (max-width: 760px) { .chat-page-header { gap: 10px; } .chat-page-header #enablePush { min-height: 34px; padding: 7px 9px; font-size: 11px; } .ops-chat-layout { gap: 10px; } .notification-inbox { display: none; } .chat-panel { min-height: 470px; height: calc(100dvh - 190px); } .chat-messages { padding: 15px 12px; } .chat-message { max-width: 90%; } .chat-quick-actions { padding-inline: 10px; } .chat-composer { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); } }

body.ops-chat-active { overflow: hidden; }
body.ops-chat-active #app, body.ops-chat-active #app > main { height: 100dvh; overflow: hidden; }
body.ops-chat-active #chatView:not(.hidden) { display: flex; min-height: 0; height: 100%; flex-direction: column; }
body.ops-chat-active .ops-chat-layout { min-height: 0; height: auto; flex: 1; }
body.ops-chat-active .chat-panel { min-height: 0; height: auto; }

@media (max-width: 760px) {
  body.ops-chat-active { padding-bottom: 0; }
  body.ops-chat-active #app > main { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); }
  .push-controls { flex-direction: column; align-items: flex-end; gap: 5px; }
  .push-status { min-height: 26px; padding: 4px 7px; font-size: 10px; }
  .push-status::before { width: 6px; height: 6px; margin-right: 4px; }
}
