.messaging-shell { padding: 26px; color: #f4f7fb; }
.messaging-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid #31506b; }
.messaging-heading span { color: #f2c900; font-weight: 800; letter-spacing: .12em; }
.messaging-heading h1 { margin: 6px 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.messaging-heading p { margin: 0; color: #a9bfd4; }
.messaging-heading button, .messaging-compose button, .messaging-message button { border: 1px solid #e5bd00; border-radius: 12px; padding: 11px 18px; background: #f2c900; color: #07111d; font-weight: 900; cursor: pointer; }
.messaging-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 22px; margin-top: 22px; }
.messaging-compose, .messaging-conversation { border: 1px solid #2d4b65; border-radius: 18px; background: linear-gradient(145deg, #10243a, #0b1a2b); box-shadow: 0 18px 44px rgba(0,0,0,.22); }
.messaging-compose { align-self: start; padding: 22px; }
.messaging-compose h2 { margin: 0 0 18px; }
.messaging-compose label { display: grid; gap: 8px; margin: 0 0 16px; color: #c6d7e7; font-weight: 700; }
.messaging-compose select, .messaging-compose textarea { width: 100%; border: 1px solid #41617d; border-radius: 11px; background: #071522; color: #fff; padding: 12px; font: inherit; }
.messaging-compose textarea { resize: vertical; min-height: 120px; }
.messaging-compose__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.messaging-compose__footer small { color: #7896b1; }
.messaging-conversation { min-height: 480px; padding: 18px; }
.messaging-feed { display: grid; gap: 14px; max-height: calc(100vh - 280px); min-height: 440px; overflow-y: auto; padding: 3px; }
.messaging-message { width: min(76%, 760px); border: 1px solid #31516d; border-radius: 16px 16px 16px 4px; background: #132a43; padding: 15px 17px; }
.messaging-message.is-outbound { justify-self: end; border-color: rgba(229,189,0,.5); border-radius: 16px 16px 4px 16px; background: #26301e; }
.messaging-message.is-transit { justify-self: center; border-color: #53718b; border-radius: 16px; background: #17283a; }
.messaging-message.is-unread { border-color: #f2c900; box-shadow: 0 0 0 1px rgba(242,201,0,.28), 0 0 22px rgba(242,201,0,.12); }
.messaging-message header, .messaging-message footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.messaging-message__route { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.messaging-message__route > div { display: grid; gap: 2px; }
.messaging-message__route > b { color: #7f9bb5; font-size: 1.1rem; }
.messaging-message__route strong { color: #f4f7fb; }
.messaging-message header span { color: #6fe2bd; font-size: .72rem; font-weight: 900; letter-spacing: .09em; }
.messaging-message.is-outbound header span { color: #f2c900; }
.messaging-message.is-transit header span { color: #9fc1dc; }
.messaging-message header small, .messaging-message time, .messaging-message__state { color: #8faac2; font-size: .8rem; }
.messaging-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 13px 0; font-size: 1.02rem; line-height: 1.5; }
.messaging-message button { padding: 8px 12px; font-size: .75rem; }
.messaging-empty { display: grid; place-items: center; min-height: 380px; color: #7f9bb5; text-align: center; }
.messaging-feedback { min-height: 24px; margin: 14px 0 0; color: #9fb7cb; }
.messaging-feedback[data-kind="success"] { color: #59ddb2; }
.messaging-feedback[data-kind="warning"] { color: #f2c900; }
.messaging-feedback[data-kind="error"] { color: #ff8181; }
.scc-menu-item--messaging,
.scc-menu-item--medevac { display: flex; align-items: center; gap: 10px; }
.messaging-unread-badge,
.medevac-unread-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: #e84141; color: #fff; font-size: .75rem; font-weight: 900; box-shadow: 0 0 14px rgba(232,65,65,.55); }
.messaging-unread-badge[hidden],
.medevac-unread-badge[hidden] { display: none; }
.soc-emergency-alert { width: min(620px, calc(100vw - 28px)); padding: 0; overflow: hidden; border: 2px solid #ff4e4e; border-radius: 22px; background: #0b1826; color: #fff; box-shadow: 0 24px 90px rgba(0,0,0,.72), 0 0 42px rgba(255,50,50,.38); }
.soc-emergency-alert::backdrop { background: rgba(2,8,15,.82); backdrop-filter: blur(5px); }
.soc-emergency-alert[open] { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
.soc-emergency-alert__signal { display: grid; place-items: center; background: linear-gradient(180deg, #f04b4b, #a80718); color: #fff; font-size: 5rem; font-weight: 1000; animation: soc-emergency-pulse 1s ease-in-out infinite alternate; }
.soc-emergency-alert__content { padding: 28px; }
.soc-emergency-alert__content > span { color: #ff7373; font-size: .78rem; font-weight: 900; letter-spacing: .15em; }
.soc-emergency-alert h2 { margin: 5px 0 10px; font-size: clamp(1.8rem, 5vw, 2.8rem); }
.soc-emergency-alert p { margin: 0 0 18px; color: #dce9f5; font-size: 1.05rem; }
.soc-emergency-alert dl { display: grid; gap: 10px; margin: 0 0 20px; }
.soc-emergency-alert dl > div { display: grid; grid-template-columns: 155px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #29445c; }
.soc-emergency-alert dt { color: #8faac2; }
.soc-emergency-alert dd { margin: 0; font-weight: 800; }
.soc-emergency-alert button { width: 100%; border: 0; border-radius: 12px; padding: 14px 18px; background: #f2c900; color: #07111d; font-weight: 1000; cursor: pointer; }
.soc-emergency-alert button:disabled { opacity: .55; cursor: wait; }
.soc-emergency-alert small { display: block; margin-top: 10px; color: #9bb2c7; text-align: center; }
@keyframes soc-emergency-pulse { from { filter: brightness(.78); } to { filter: brightness(1.28); } }
@media (max-width: 900px) {
    .messaging-shell { padding: 18px; }
    .messaging-heading { align-items: start; }
    .messaging-layout { grid-template-columns: 1fr; }
    .messaging-message { width: 92%; }
    .messaging-feed { max-height: none; }
    .soc-emergency-alert[open] { grid-template-columns: 1fr; }
    .soc-emergency-alert__signal { min-height: 72px; font-size: 3rem; }
    .soc-emergency-alert dl > div { grid-template-columns: 1fr; gap: 3px; }
}
