/* ============================================================
   GREEN BADGER — HEADER NOTICE CENTER
   One bell/count for announcement + Action Nudge unread items.
   Desktop: compact popover anchored under the clicked bell.
   Mobile: existing App Shell bottom sheet.
   ============================================================ */

.dm-notice-trigger {
	position: relative;
}

/* unread count belongs to the bell itself */
.dm-notice-badge {
	position: absolute;
	top: 4px;
	right: 2px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 15px;
	height: 15px;
	padding: 0 4px;
	border: 2px solid var(--dm-black, #0b0b0a);
	border-radius: 999px;
	background: #b33f38;
	color: #fff;
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 9px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	pointer-events: none;
	z-index: 4;
}

.dm-notice-badge[hidden] {
	display: none !important;
}

/* Desktop STAMP + bell read as one utility cluster, not oversized nav icons. */
body.dm-header-skin-enabled .main-header-menu > .dm-header-action-stamp > .menu-link,
body.dm-header-skin-enabled .main-header-menu > .dm-header-action-notice > .menu-link {
	position: relative;
	min-width: 34px;
	width: 34px;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.dm-header-skin-enabled .dm-header-action-notice .dm-ic {
	display: block;
	width: 19px !important;
	height: 19px !important;
	fill: none !important;
	stroke: currentColor;
	stroke-width: 1.7;
}

body.dm-header-skin-enabled .dm-header-action-notice .dm-notice-badge {
	top: 4px;
	right: -2px;
}

/* Keep STAMP and bell adjacent even if generic header-action margins change. */
body.dm-header-skin-enabled .main-header-menu > .dm-header-action-stamp + .dm-header-action-notice {
	margin-left: 4px;
}

#dm-sheet-notice .dm-sheet__title::before {
	content: "NOTICE";
	display: block;
	margin-bottom: 5px;
	color: var(--dm-gold, #b89a5b);
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .2em;
}

/* Desktop = small message popover under the bell. The transparent scrim still
   catches outside clicks, but the page is not visually dimmed. */
@media (min-width: 1024px) {
	#dm-sheet-notice .dm-sheet__scrim {
		background: transparent;
		backdrop-filter: none;
	}

	#dm-sheet-notice .dm-sheet__panel {
		inset: var(--dm-notice-panel-top, 82px) var(--dm-notice-panel-right, 20px) auto auto;
		width: min(370px, calc(100vw - 32px));
		max-height: min(560px, calc(100vh - var(--dm-notice-panel-top, 82px) - 16px));
		padding-bottom: 0;
		border: 1px solid rgba(184, 154, 91, .42);
		border-radius: 0;
		box-shadow: 0 22px 60px rgba(0, 0, 0, .46);
		opacity: 0;
		transform: translateY(-7px) scale(.985);
		transform-origin: 100% 0;
		transition: opacity 160ms ease, transform 180ms ease;
	}

	#dm-sheet-notice.is-open .dm-sheet__panel {
		opacity: 1;
		transform: none;
	}

	#dm-sheet-notice .dm-sheet__head {
		padding: 12px 16px;
		touch-action: auto;
	}

	#dm-sheet-notice .dm-sheet__body {
		padding: 14px 16px 16px;
	}
}

.dm-notice-list {
	display: grid;
	gap: 0;
}

.dm-notice-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--dm-hairline, rgba(184, 154, 91, .28));
}

.dm-notice-item:first-child { padding-top: 0; }
.dm-notice-item:last-child { border-bottom: 0; padding-bottom: 0; }

.dm-notice-item__text {
	margin: 0;
	color: var(--dm-cream, #f4f1e8);
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 13px;
	line-height: 1.65;
}

.dm-notice-item__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 38px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--dm-gold, #b89a5b) !important;
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 11px;
	font-weight: 700;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.dm-notice-item__link:hover,
.dm-notice-item__link:focus-visible {
	background: none;
	color: var(--dm-cream, #f4f1e8) !important;
}

.dm-notice-item__link:focus { outline: none; }
.dm-notice-item__link:focus-visible {
	outline: 1px solid var(--dm-gold, #b89a5b);
	outline-offset: 3px;
}
.dm-notice-item__link b { font-weight: 400; }

.dm-notice-empty {
	margin: 0;
	padding: 2px 0;
	color: rgba(244, 241, 232, .52);
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 13px;
	line-height: 1.7;
}

@media (max-width: 380px) {
	.dm-notice-item {
		grid-template-columns: 1fr;
		gap: 7px;
	}
	.dm-notice-item__link { justify-self: start; }
}
