.apcs-popup-notice-layer {
	position: fixed;
	inset: 0;
	margin: 0;
	pointer-events: none;
	z-index: 80;
}

.apcs-popup-notice-layer__overlay {
	position: fixed;
	inset: 0;
	pointer-events: auto;
	background: rgb(18 20 23 / 0.45);
}

.apcs-popup-notice-layer__dialog {
	position: fixed;
	inset: 50% auto auto 50%;
	z-index: 81;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: min(640px, calc(100vw - 32px));
	max-height: 85vh;
	overflow: hidden;
	transform: translate(-50%, -50%);
	border: 1px solid var(--apcs-border, #d7d2cc);
	background: var(--wp--preset--color--apcs-panel, #fcfbfa);
	color: var(--apcs-ink, #121417);
	box-shadow: 0 20px 40px rgb(18 20 23 / 0.14);
	pointer-events: auto;
}

.apcs-popup-notice-layer__dialog[hidden],
.apcs-popup-notice-layer__overlay[hidden],
.apcs-popup-notice-layer__placeholder[hidden] {
	display: none;
}

.apcs-popup-notice-layer__header,
.apcs-popup-notice-layer__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid rgb(215 210 204 / 0.9);
}

.apcs-popup-notice-layer__footer {
	border-top: 1px solid rgb(215 210 204 / 0.9);
	border-bottom: 0;
}

.apcs-popup-notice-layer__header-meta {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 10px;
	min-width: 0;
}

.apcs-popup-notice-layer__queue-label,
.apcs-popup-notice-layer__variant {
	margin: 0;
	font-family: Manrope, sans-serif;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.apcs-popup-notice-layer__queue-label[hidden] {
	display: none;
}

.apcs-popup-notice-layer__variant {
	color: var(--apcs-accent, #4c6078);
}

.apcs-popup-notice-layer__dialog--warning .apcs-popup-notice-layer__variant {
	color: #7a5e1c;
}

.apcs-popup-notice-layer__content {
	overflow: auto;
	padding: 28px 24px;
}

.apcs-popup-notice-layer__content > :first-child {
	margin-top: 0;
}

.apcs-popup-notice-layer__content > :last-child {
	margin-bottom: 0;
}

.apcs-popup-notice-layer__content h1,
.apcs-popup-notice-layer__content h2,
.apcs-popup-notice-layer__content h3 {
	margin: 0 0 16px;
	font-family: "Noto Sans CJK KR", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.04em;
}

.apcs-popup-notice-layer__content p,
.apcs-popup-notice-layer__content li {
	font-family: Manrope, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

.apcs-popup-notice-layer__content .wp-block-image,
.apcs-popup-notice-layer__content .wp-block-cover {
	margin: 0 0 18px;
}

.apcs-popup-notice-layer__close,
.apcs-popup-notice-layer__secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid rgb(215 210 204 / 0.9);
	border-radius: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.apcs-popup-notice-layer__close {
	min-width: 36px;
	min-height: 36px;
	padding: 0;
}

.apcs-popup-notice-layer__close:focus-visible,
.apcs-popup-notice-layer__secondary:focus-visible,
.apcs-popup-notice-layer__footer .wp-element-button:focus-visible {
	outline: 2px solid rgb(76 96 120 / 0.65);
	outline-offset: 3px;
}

.apcs-popup-notice-layer__footer .wp-block-buttons {
	margin-left: auto;
}

.apcs-popup-notice-layer__footer .wp-block-buttons .wp-block-button__link {
	white-space: nowrap;
}

.apcs-popup-notice-layer__placeholder {
	position: fixed;
	inset: 120px 24px auto 24px;
	z-index: 81;
	max-width: 560px;
	padding: 24px;
	border: 1px solid var(--apcs-border, #d7d2cc);
	background: var(--wp--preset--color--apcs-panel, #fcfbfa);
	pointer-events: auto;
}

.apcs-popup-notice-layer__placeholder-title,
.apcs-popup-notice-layer__placeholder-copy {
	margin: 0;
}

.apcs-popup-notice-layer__placeholder-title {
	margin-bottom: 8px;
	font-family: "Noto Sans CJK KR", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.08;
}

.apcs-popup-notice-layer__placeholder-copy {
	font-family: Manrope, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--apcs-muted, #516171);
}

/* Image notice: one flyer image, sized to the image, with text controls below. */
/* Centered with auto margins, not left: 50%, so the dialog can shrink-wrap
   an image wider than half the viewport. The doubled class outranks the
   tablet and mobile dialog sizes below. */
.apcs-popup-notice-layer__dialog.apcs-popup-notice-layer__dialog--image {
	inset: 0;
	grid-template-rows: minmax(0, 1fr) auto;
	width: fit-content;
	height: fit-content;
	max-width: calc(100vw - 32px);
	margin: auto;
	transform: none;
	max-height: 92vh;
	max-height: 92dvh;
	border: 0;
	background: #fff;
	box-shadow: 0 24px 48px rgb(18 20 23 / 0.28);
}

.apcs-popup-notice-layer__dialog--image:focus {
	outline: none;
}

.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__content {
	padding: 0;
	overflow: hidden;
}

.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__content .wp-block-image {
	margin: 0;
}

.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__content img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(960px, calc(100vw - 32px));
	max-height: calc(92vh - 52px);
	max-height: calc(92dvh - 52px);
}

.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__footer {
	padding: 4px 8px;
	border-top: 0;
	background: #fff;
}

.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__secondary {
	min-height: 44px;
	padding: 0 8px;
	border: 0;
	font-family: Manrope, sans-serif;
	font-size: 14px;
	font-weight: 600;
}

.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__secondary:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

body.apcs-popup-notice-layer-open {
	overflow: hidden;
}

@media (max-width: 1279px) {
	.apcs-popup-notice-layer__dialog {
		width: min(560px, calc(100vw - 28px));
	}

	.apcs-popup-notice-layer__content {
		padding: 24px;
	}

	.apcs-popup-notice-layer__content h1,
	.apcs-popup-notice-layer__content h2,
	.apcs-popup-notice-layer__content h3 {
		font-size: 28px;
		line-height: 1.08;
	}
}

@media (max-width: 767px) {
	.apcs-popup-notice-layer__dialog {
		inset: 0;
		width: 100%;
		max-height: 100dvh;
		transform: none;
		border: 0;
	}

	.apcs-popup-notice-layer__header,
	.apcs-popup-notice-layer__footer {
		position: sticky;
		z-index: 2;
		background: var(--wp--preset--color--apcs-panel, #fcfbfa);
		padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
	}

	.apcs-popup-notice-layer__footer {
		bottom: 0;
		top: auto;
		padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
	}

	.apcs-popup-notice-layer__content {
		padding: 20px 16px 28px;
	}

	.apcs-popup-notice-layer__content h1,
	.apcs-popup-notice-layer__content h2,
	.apcs-popup-notice-layer__content h3 {
		font-size: 24px;
		line-height: 1.12;
	}

	.apcs-popup-notice-layer__footer {
		display: grid;
		grid-template-columns: 1fr;
	}

	.apcs-popup-notice-layer__secondary,
	.apcs-popup-notice-layer__footer .wp-block-buttons,
	.apcs-popup-notice-layer__footer .wp-block-buttons .wp-block-button,
	.apcs-popup-notice-layer__footer .wp-block-buttons .wp-block-button__link {
		width: 100%;
	}

	.apcs-popup-notice-layer__placeholder {
		inset: 96px 16px auto 16px;
		max-width: none;
	}
}

@media (max-width: 767px) {
	.apcs-popup-notice-layer__dialog.apcs-popup-notice-layer__dialog--image {
		inset: 0;
		width: fit-content;
		max-width: calc(100vw - 24px);
		max-height: 92dvh;
		transform: none;
	}

	.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__content img {
		max-width: calc(100vw - 24px);
		max-height: calc(92dvh - 52px);
	}

	.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__footer {
		position: static;
		display: flex;
		padding: 4px 8px;
	}

	.apcs-popup-notice-layer__dialog--image .apcs-popup-notice-layer__secondary {
		width: auto;
	}
}
