/* Layout móvil forzado por JS (html.jc-mobile).
 * Se carga después de jangachat.css y no depende de media queries,
 * del puntero ni del viewport: si el navegador es de teléfono, manda. */

html.jc-mobile body {
	grid-template-columns: 0 1fr 0 !important;
}

html.jc-mobile #jc-topbar {
	gap: 6px !important;
	padding: 0 10px !important;
}

html.jc-mobile .jc-top-brand span,
html.jc-mobile .jc-top-search-label,
html.jc-mobile .jc-top-status {
	display: none !important;
}

html.jc-mobile .jc-top-btn,
html.jc-mobile .jc-top-search {
	width: 34px !important;
	height: 34px !important;
	padding: 0 !important;
	gap: 0 !important;
}

html.jc-mobile .jc-radio-side {
	display: none !important;
}

html.jc-mobile #jc-btn-radio {
	display: flex !important;
}

html.jc-mobile #buffer-list,
html.jc-mobile #member-list {
	position: fixed !important;
	top: calc(56px + env(safe-area-inset-top, 0px)) !important;
	bottom: env(safe-area-inset-bottom, 0px) !important;
	width: 0 !important;
	height: auto !important;
	z-index: 900 !important;
	background: transparent !important;
	border: 0 !important;
}

html.jc-mobile #buffer-list { left: 0 !important; }
html.jc-mobile #member-list { right: 0 !important; }

html.jc-mobile #buffer-list > ul,
html.jc-mobile #member-list > section {
	width: 0 !important;
	overflow: hidden !important;
	padding-bottom: 0 !important;
}

html.jc-mobile #buffer-list > ul {
	flex: 0 0 0 !important;
	min-width: 0 !important;
	max-width: 0 !important;
}

html.jc-mobile #buffer-list:not(.expand) > ul,
html.jc-mobile #member-list:not(.expand) > section {
	display: none !important;
}

html.jc-mobile #buffer-list.expand > ul { display: block !important; }
html.jc-mobile #member-list.expand > section { display: flex !important; }

html.jc-mobile #buffer-list .expander,
html.jc-mobile #member-list .expander {
	position: fixed !important;
	top: auto !important;
	bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
	transform: none !important;
	display: block !important;
	width: 14px !important;
	height: 42px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 8px 8px 0 !important;
	background: rgba(10, 16, 30, 0.72) !important;
	box-shadow: 0 0 16px rgba(0, 0, 0, 0.45) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 901 !important;
}

html.jc-mobile #buffer-list .expander { left: 0 !important; }
html.jc-mobile #member-list .expander {
	right: 0 !important;
	border-radius: 8px 0 0 8px !important;
}

html.jc-mobile #buffer-list .expander span,
html.jc-mobile #member-list .expander span {
	height: 1px !important;
	margin-bottom: 3px !important;
	border-color: rgba(6, 214, 160, 0.6) !important;
}

html.jc-mobile #buffer-list.expand,
html.jc-mobile #member-list.expand {
	width: min(84vw, 340px) !important;
	background: rgba(8, 12, 24, 0.97) !important;
	border: 1px solid var(--jc-line) !important;
	box-shadow: 0 0 60px rgba(0, 0, 0, 0.6) !important;
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
}

html.jc-mobile #buffer-list.expand > ul,
html.jc-mobile #member-list.expand > section {
	width: 100% !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
}

html.jc-mobile #buffer-list.expand > ul {
	flex: 1 1 auto !important;
	max-width: none !important;
	padding-left: 14px !important;
}

html.jc-mobile #member-list.expand > section { padding-right: 14px !important; }

html.jc-mobile #buffer-list.expand .expander,
html.jc-mobile #member-list.expand .expander {
	background: transparent !important;
	box-shadow: none !important;
}

html.jc-mobile #buffer-header {
	padding: 8px 10px !important;
}

html.jc-mobile #buffer-header .actions {
	align-self: start !important;
}

html.jc-mobile #buffer-header .actions button {
	padding: 5px 8px !important;
	font-size: 11px !important;
}

html.jc-mobile body:has(#composer input:focus) #buffer-list .expander,
html.jc-mobile body:has(#composer input:focus) #member-list .expander {
	display: none !important;
}

html.jc-mobile .jc-panel {
	top: 62px !important;
	right: 10px !important;
	width: min(92vw, 264px) !important;
}
