/* Pikabu-style OAuth modal */
.ilyt-modal--auth {
	padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
}

.ilyt-auth-modal__dialog {
	width: 100%;
	max-width: min(400px, calc(100vw - 1.5rem));
	max-height: calc(100dvh - 1.5rem);
	padding: 0;
	overflow-x: hidden;
	overflow-y: auto;
	border-radius: clamp(14px, 3vw, 20px);
}

.ilyt-modal--auth .ilyt-modal__close {
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	color: #6b7280;
}

.ilyt-oauth-panel {
	display: flex;
	flex-direction: column;
	padding: 2.75rem clamp(1rem, 4vw, 1.5rem) clamp(1rem, 3vw, 1.5rem);
	box-sizing: border-box;
}

.ilyt-modal--auth .ilyt-oauth-panel__banner {
	margin: 0 0 1rem;
	padding: 0.75rem clamp(2.25rem, 8vw, 2.5rem) 0.75rem clamp(1rem, 4vw, 1.25rem);
	background: var(--ilyt-warn-bg);
	color: var(--ilyt-warn-text);
	font-size: clamp(0.8125rem, 3vw, 0.875rem);
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	border-bottom: 1px solid var(--ilyt-warn-border);
}

.ilyt-oauth-panel__title {
	margin: 0 0 0.75rem;
	padding-right: 2rem;
	font-size: clamp(1.2rem, 5vw, 1.5rem);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: var(--ilyt-text, #1f2937);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.ilyt-oauth-panel__title:empty {
	display: none;
}

.ilyt-oauth-panel__lead {
	margin: 0 0 1rem;
	font-size: clamp(0.8125rem, 3.2vw, 0.875rem);
	line-height: 1.5;
	text-align: center;
	color: var(--ilyt-muted, #6b7280);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.ilyt-oauth-panel__section-title {
	margin: 0 0 1rem;
	font-size: clamp(1rem, 4vw, 1.125rem);
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	color: var(--ilyt-text, #1f2937);
}

.ilyt-cabinet-auth--oauth .ilyt-oauth-panel__section-title {
	margin-top: 0;
	margin-bottom: 0.35rem;
}

.ilyt-oauth-panel__divider {
	position: relative;
	margin: 12px 0;
	text-align: center;
	font-size: 0.8125rem;
	color: var(--ilyt-muted, #9ca3af);
}

.ilyt-oauth-panel__divider::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--ilyt-border, #e5e7eb);
}

.ilyt-oauth-panel__divider span {
	position: relative;
	display: inline-block;
	padding: 0 0.75rem;
	background: var(--ilyt-bg, #fff);
}

.ilyt-oauth-panel__social {
	margin: 0;
	min-width: 0;
	flex: 0 0 auto;
}

.ilyt-oauth-panel__hint {
	margin: 0 0 1rem;
}

/* Cabinet page — same panel without modal chrome */
.ilyt-cabinet-auth--oauth .ilyt-oauth-panel {
	max-width: 400px;
	margin: 0 auto;
	padding: 0;
}

.ilyt-cabinet-auth--oauth .ilyt-oauth-panel__title {
	font-size: 1.35rem;
	padding-right: 0;
}

.ilyt-cabinet-auth--oauth .ilyt-oauth-panel__banner {
	display: none;
}

@media (max-width: 480px) {
	.ilyt-auth-modal__dialog {
		border-radius: 16px;
	}

	.ilyt-oauth-panel {
		padding-top: 2.5rem;
	}

	.ilyt-nav__write {
		width: 100%;
		justify-content: center;
	}
}

@media (max-height: 520px) {
	.ilyt-auth-modal__dialog {
		max-height: calc(100dvh - 1rem);
	}

	.ilyt-oauth-panel {
		padding-top: 2.25rem;
		padding-bottom: 0.75rem;
	}
}
