.notices {
    width: 100%;
    margin: 0;
    color: var(--theme-text-primary);
}

.notices.notices--flat {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 360px;
}

.notices-messages {
    list-style: none;
    margin: 0;
    padding: var(--theme-space-sm, 12px);
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--theme-space-sm, 12px);
    background: var(--theme-bg-secondary, #f5f5f5);
    border-radius: var(--theme-radius-md, 10px);
}

.notices-messages-empty {
    margin: auto;
    padding: var(--theme-space-md, 16px);
    text-align: center;
    color: var(--theme-text-secondary);
    font-style: italic;
}

.notices-message {
    display: flex;
    align-items: flex-start;
    gap: var(--theme-space-sm, 12px);
}

.notices-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: var(--theme-bg-tertiary, #ececec);
    color: var(--theme-text-secondary);
    font-weight: 600;
    font-size: 0.95em;
}

.notices-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.notices-avatar--placeholder {
    background: var(--theme-color-primary, #2e7df1);
    color: var(--theme-text-inverse, #fff);
}

.notices-author-trigger {
    cursor: pointer;
    transition: filter 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.notices-author-trigger:hover,
.notices-author-trigger:focus-visible {
    outline: none;
    filter: brightness(1.05);
}

.notices-message-author.notices-author-trigger:hover,
.notices-message-author.notices-author-trigger:focus-visible {
    color: var(--theme-color-primary, #2e7df1);
    text-decoration: underline;
}

.notices-avatar.notices-author-trigger:active {
    transform: scale(0.96);
}

.notices-message-bubble {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--theme-space-xs, 6px);
    padding: var(--theme-space-sm, 12px) var(--theme-space-md, 16px);
    background: var(--theme-bg-primary, #fff);
    border-radius: var(--theme-radius-md, 10px);
    border: 1px solid var(--theme-border-subtle, #e4e4e7);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.notices-message-bubble.is-editing {
    border-color: var(--theme-color-primary, #2e7df1);
    box-shadow: 0 0 0 2px var(--theme-color-primary-soft, rgba(46, 125, 241, 0.18));
}

.notices-message-header {
    display: flex;
    align-items: center;
    gap: var(--theme-space-sm, 12px);
}

.notices-message-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notices-message-author {
    font-weight: 600;
    color: var(--theme-text-primary);
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notices-message-time {
    font-size: 0.75em;
    color: var(--theme-text-secondary);
    line-height: 1.3;
}

.notices-edited {
    font-style: italic;
    color: var(--theme-text-secondary);
}

.notices-message-read {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    vertical-align: middle;
}

.notices-message-read.is-read {
    color: var(--theme-text-secondary);
    opacity: 0.7;
}

.notices-message-read.is-unread {
    color: var(--theme-color-primary);
}

.notices-message-body {
    margin: 0;
    color: var(--theme-text-primary);
    font-size: 0.95em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.notices-menu {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.notices-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--theme-text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
}

.notices-menu-button:hover,
.notices-menu-button:focus-visible {
    background: var(--theme-bg-secondary, #f5f5f5);
    color: var(--theme-text-primary);
    outline: none;
}

.notices-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: var(--theme-space-xs, 6px) 0;
    list-style: none;
    background: var(--theme-bg-primary);
    border: 1px solid var(--theme-border-subtle, #e4e4e7);
    border-radius: var(--theme-radius-md, 10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 20;
}

.notices-menu-option {
    padding: var(--theme-space-xs, 6px) var(--theme-space-sm, 12px);
    font-size: 0.9em;
    color: var(--theme-text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease;
}

.notices-menu-option:hover {
    background: var(--theme-bg-secondary, #f5f5f5);
}

.notices-menu-option--danger {
    color: var(--theme-color-danger, #dc3545);
}

.notices-composer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--theme-space-xs, 6px);
    padding: var(--theme-space-sm, 12px);
    background: var(--theme-bg-primary);
    border-top: 1px solid var(--theme-border-subtle, #e4e4e7);
}

.notices-composer-edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--theme-space-sm, 12px);
    padding: 6px 10px;
    border-radius: var(--theme-radius-sm, 6px);
    background: var(--theme-color-primary-soft, rgba(46, 125, 241, 0.12));
    color: var(--theme-text-primary);
    font-size: 0.85em;
}

.notices-composer-edit-banner[hidden] {
    display: none;
}

.notices-composer-edit-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.notices-composer-edit-cancel {
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: var(--theme-radius-sm, 6px);
    cursor: pointer;
    color: var(--theme-color-primary, #2e7df1);
    font: inherit;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.12s ease;
}

.notices-composer-edit-cancel:hover,
.notices-composer-edit-cancel:focus-visible {
    background: var(--theme-bg-secondary, #f5f5f5);
    outline: none;
}

.notices-composer-row {
    display: flex;
    align-items: flex-end;
    gap: var(--theme-space-sm, 12px);
    padding: var(--theme-space-xs, 6px) var(--theme-space-sm, 12px);
    border-radius: 999px;
    background: var(--theme-bg-secondary, #f5f5f5);
    border: 1px solid var(--theme-border-subtle, #e4e4e7);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notices-composer-row:focus-within {
    border-color: var(--theme-color-primary, #2e7df1);
    box-shadow: 0 0 0 3px var(--theme-color-primary-soft, rgba(46, 125, 241, 0.15));
}

.notices-composer-textarea {
    flex: 1 1 auto;
    min-height: 24px;
    max-height: 180px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: var(--theme-text-primary);
    font: inherit;
    font-size: 0.95em;
    line-height: 1.4;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.notices-composer-textarea::placeholder {
    color: var(--theme-text-secondary);
}

.notices-composer-button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--theme-color-primary, #2e7df1);
    color: var(--theme-text-inverse, #fff);
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    box-shadow: 0 2px 6px rgba(46, 125, 241, 0.25);
}

.notices-composer-button:hover,
.notices-composer-button:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

.notices-composer-button:active {
    transform: scale(0.96);
}

.notices-composer-notice {
    margin: 0;
    padding: var(--theme-space-sm, 12px);
    border-radius: var(--theme-radius-sm, 6px);
    background: var(--theme-bg-secondary, #f5f5f5);
    color: var(--theme-text-secondary);
    font-size: 0.9em;
    text-align: center;
    font-style: italic;
    width: 100%;
}

.notices-messages > :last-child {
    margin-bottom: var(--theme-space-sm, 12px);
}

@media (max-width: 560px) {
    .notices.notices--flat {
        min-height: 0;
    }
    .notices-message-bubble {
        padding: var(--theme-space-xs, 6px) var(--theme-space-sm, 12px);
    }
    .notices-composer {
        padding: var(--theme-space-xs, 6px);
    }
}
