/* System announcements live in the top layer, outside dashboard sizing. */
.hm-system-message {
    width: min(940px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 2px solid #ffd66a;
    border-radius: 28px;
    background: #fffaf1;
    color: #19324d;
    overflow: auto;
    box-shadow: 0 28px 90px #12244266, 0 0 0 7px #ffffff1f;
}
.hm-system-message[open] { animation: hm-notice-enter 460ms cubic-bezier(.18, .9, .3, 1.12) both; }
.hm-system-message::backdrop {
    background: linear-gradient(135deg, #13234599, #22465688);
    backdrop-filter: blur(5px);
    animation: hm-notice-backdrop 300ms ease both;
}
.hm-system-message__layout { display: grid; grid-template-columns: 38% minmax(0, 1fr); }
.hm-system-message__visual {
    position: relative;
    display: grid;
    align-items: center;
    padding: 24px 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 25% 18%, #ffdb6899 0, transparent 35%),
        radial-gradient(circle at 85% 80%, #82e9d1aa 0, transparent 45%),
        linear-gradient(155deg, #196f88, #344e86 55%, #6554a4);
}
.hm-system-message__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .22;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 20px 20px;
}
.hm-system-message__visual img {
    position: relative;
    width: 100%;
    height: min(64dvh, 510px);
    object-fit: contain;
    filter: drop-shadow(0 16px 14px #12234855);
    animation: hm-notice-float 5s ease-in-out 500ms infinite;
}
.hm-system-message__spark { position: absolute; color: #ffe18a; font-size: 38px; text-shadow: 0 0 22px #ffe18a99; }
.hm-system-message__spark--one { top: 24px; right: 25px; transform: rotate(12deg); }
.hm-system-message__spark--two { bottom: 25px; left: 20px; font-size: 24px; transform: rotate(-12deg); }
.hm-system-message__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(24px, 4vw, 46px);
    background: radial-gradient(ellipse at 100% 0, #ffe6a855, transparent 70%), #fffaf1;
}
.hm-system-message__eyebrow {
    align-self: flex-start;
    padding: 6px 11px;
    border-radius: 20px;
    background: #d9f1eb;
    color: #226856;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
}
.hm-system-message h2 { margin: 18px 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.14; font-weight: 800; }
.hm-system-message h2 span { color: #bd7714; }
.hm-system-message__copy {
    max-height: 42dvh;
    padding: 2px 8px 2px 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #3f5263;
    font-size: 1.03rem;
    line-height: 1.65;
    scrollbar-color: #d6aa58 #fff1d7;
    scrollbar-width: thin;
}
.hm-system-message__copy:focus-visible { outline: 2px solid #248e98; outline-offset: 3px; border-radius: 4px; }
.hm-system-message__footer { display: flex; justify-content: flex-end; margin-top: 24px; }
.hm-system-message__footer button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    min-width: 142px;
    min-height: 48px;
    padding: 12px 22px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffcf53, #ffab40);
    color: #26324b;
    font: inherit;
    font-weight: 800;
    box-shadow: 0 7px 18px #dfa12440;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.hm-system-message__footer button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px #dfa12466; }
.hm-system-message__footer button:focus-visible { outline: 3px solid #187b8c; outline-offset: 4px; }
.hm-system-message__footer button:disabled { cursor: wait; opacity: .7; transform: none; }
.hm-system-message__error { margin: 16px 0 0; color: #a63232; font-size: .9rem; }
.hm-system-message__error[hidden] { display: none; }
@keyframes hm-notice-enter { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hm-notice-backdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes hm-notice-float { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-4px); } }
@media (max-width: 600px) {
    .hm-system-message { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 20px; }
    .hm-system-message__layout { grid-template-columns: 27% minmax(0, 1fr); }
    .hm-system-message__visual { padding: 12px 2px; }
    .hm-system-message__visual img { height: auto; max-height: 70dvh; }
    .hm-system-message__spark { font-size: 22px; right: 8px; }
    .hm-system-message__spark--two { left: 8px; }
    .hm-system-message__body { padding: 22px 16px; }
    .hm-system-message__eyebrow { font-size: .65rem; padding: 5px 8px; }
    .hm-system-message h2 { margin: 14px 0; font-size: 25px; }
    .hm-system-message__copy { font-size: .94rem; line-height: 1.55; max-height: 42dvh; }
    .hm-system-message__footer { margin-top: 18px; }
    .hm-system-message__footer button { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hm-system-message[open], .hm-system-message::backdrop, .hm-system-message__visual img { animation: none; }
    .hm-system-message__footer button { transition: none; }
}
