/* Date fields in the user's own date format (mwlIncludes/class.mwlDateField.php, js/date-field).
   The text field keeps the page's own look (its class from the page); the calendar button sits inside it at the
   right end, as the browser's own date field has it (Magnus 2026-11-21). The browser's date field lies on top of
   the button, transparent and just as big, so a click or tap on the icon lands on the date field and its picker
   opens next to the icon: Safari on iOS opens the picker only for a tap on the date field itself (Magnus
   2026-11-23).
   The selectors name the input type and the parent (span.mwlDate > ...[type=...]) so they win over the pages' own
   field rules (form.plogForm input[type=date] ...) and the site's general button style. */
/* As wide as the text field, also as a flex item (in a flex <label> it would otherwise stretch and leave the
   button outside the field) */
span.mwlDate
{
	position:relative;
	display:inline-block;
	width:max-content;
	align-self:flex-start;
}
/* The date centred in its field, with room at the right for the button (Magnus 2026-11-21) */
span.mwlDate > input.mwlDateText[type=text]
{
	box-sizing:border-box;
	width:9.5em;
	padding-right:2em;
	text-align:center;
}
/* Over the button (the right 2.25em of the field, its full height), on top of it, invisible. font-size:inherit
   so that em is the page's size, not the browser's smaller default for fields */
span.mwlDate > input.mwlDateNative[type=date]
{
	position:absolute;
	z-index:1;
	top:0;
	right:0;
	box-sizing:border-box;
	width:2.25em;
	font-size:inherit;
	height:100%;
	min-width:0;
	min-height:0;
	margin:0;
	padding:0;
	border:0;
	opacity:0;
	cursor:pointer;
}
span.mwlDate > input.mwlDateNative[type=date]:disabled
{
	cursor:default;
}
span.mwlDate > button.mwlDateButton[type=button]
{
	position:absolute;
	top:50%;
	right:4px;
	transform:translateY(-50%);
	width:auto;
	height:auto;
	min-width:0;
	margin:0;
	padding:4px 6px;
	border:0;
	border-radius:4px;
	box-shadow:none;
	background:none;
	color:var(--text-brand);
	font-size:1.1em;
	line-height:1;
	cursor:pointer;
	opacity:0.7;
	/* Only shows the icon: a click at its edge goes to the date field or the text field */
	pointer-events:none;
}
span.mwlDate > input.mwlDateNative[type=date]:not(:disabled):hover + button.mwlDateButton[type=button]
{
	background:none;
	box-shadow:none;
	opacity:1;
}
span.mwlDate > input.mwlDateText[type=text].mwlDateInvalid
{
	border-color:var(--border-danger-4);
	box-shadow:0 0 0 2px var(--bg-danger-1);
}
