/* Calendar Studio (extension package). Modal chrome (backdrop, frame,
   header, footer, close, scrollbars, selects, labels) comes from the
   editor's modal design - the dialog mounts inside #wpie-root. Only
   studio-specific parts live here (wpiecal- prefix so Map Studio and
   this pack can coexist). */

.wpiecal-dialog {
	width: min( 1140px, 96vw );
	height: min( 720px, 92vh );
}

/* Native date fields: color-scheme makes the browser render the calendar
   picker icon and internal text to match the theme. Without it the icon
   is black and invisible on the dark input background. */
.wpiecal-side input[ type='date' ],
.wpiecal-side input[ type='time' ] {
	color-scheme: light;
}

#wpie-root[ data-theme='dark' ] .wpiecal-side input[ type='date' ],
#wpie-root[ data-theme='dark' ] .wpiecal-side input[ type='time' ] {
	color-scheme: dark;
}

.wpiecal-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.wpiecal-view {
	position: relative;
	display: grid;
	flex: 1;
	place-items: center;
	min-width: 0;
	background:
		repeating-conic-gradient(
			rgba( 128, 128, 128, 0.07 ) 0 25%,
			transparent 0 50%
		)
		0 0 / 22px 22px;
}

.wpiecal-view canvas {
	background: transparent;
}


.wpiecal-empty {
	position: absolute;
	max-width: 300px;
	padding: 14px 18px;
	font-size: 13px;
	line-height: 1.5;
	color: var( --ed-text, #e6e8ee );
	text-align: center;
	pointer-events: none;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.3 );
}

.wpiecal-status {
	position: absolute;
	bottom: 14px;
	left: 50%;
	display: none;
	max-width: 78%;
	padding: 7px 14px;
	font-size: 11px;
	line-height: 1.4;
	color: var( --ed-text, #e6e8ee );
	text-align: center;
	pointer-events: none;
	background: var( --ed-panel, #1d2126 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.3 );
	transform: translateX( -50% );
}

.wpiecal-status.on {
	display: block;
}

.wpiecal-status.err {
	color: #f28b82;
	border-color: rgba( 242, 139, 130, 0.5 );
}

.wpiecal-side {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 10px;
	width: 364px;
	padding: 12px 14px;
	overflow-x: hidden;
	overflow-y: auto;
	font-size: 12px;
	border-left: 1px solid var( --ed-border, #333a44 );
}

/* The side is a flex column: without this its section cards keep their
   default flex-shrink and get compressed to fit the panel height instead
   of overflowing, so overflow-y: auto never triggers and the scrollbar
   never appears. Pinning the direct children to their natural height lets
   the column overflow and scroll. */
.wpiecal-side > * {
	flex-shrink: 0;
}

.wpiecal-section {
	padding-top: 8px;
	border-top: 1px solid var( --ed-border, rgba( 128, 128, 128, 0.15 ) );
}

.wpiecal-section:first-child {
	padding-top: 0;
	border-top: 0;
}

.wpiecal-label {
	display: block;
	margin-bottom: 6px;
}

/* Icon-headed section cards (matching the other studios). */
.wpiecal-card {
	background: var( --ed-panel-alt, rgba( 255, 255, 255, 0.03 ) );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 10px;
	overflow: hidden;
}

.wpiecal-card-head {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 10px 12px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --ed-text-dim, #b9c0cc );
}

.wpiecal-card-head svg {
	flex: none;
	opacity: 0.85;
}

.wpiecal-card-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px 12px 12px;
}

#wpie-root .wpiecal-check {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
}

#wpie-root .wpiecal-check input {
	width: 15px;
	height: 15px;
	accent-color: var( --accent, #3b66ff );
}




.wpiecal-btn {
	padding: 6px 12px;
	font-size: 12px;
	color: inherit;
	cursor: pointer;
	background: rgba( 128, 128, 128, 0.12 );
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

.wpiecal-btn:hover {
	background: rgba( 128, 128, 128, 0.2 );
}

.wpiecal-import {
	width: 100%;
	margin-top: 8px;
}





.wpiecal-coords {
	margin-top: 5px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiecal-row {
	display: grid;
	grid-template-columns: 78px 1fr auto;
	gap: 8px;
	align-items: center;
	margin: 5px 0;
}

.wpiecal-row > span {
	overflow: hidden;
	white-space: nowrap;
}

.wpiecal-row input[type='range'] {
	width: 100%;
	accent-color: var( --ed-accent, #3b82f6 );
}


.wpiecal-row output {
	min-width: 48px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	text-align: right;
}

.wpiecal-check {
	display: flex;
	gap: 7px;
	align-items: center;
	margin: 4px 0;
	cursor: pointer;
}

.wpiecal-check input {
	accent-color: var( --ed-accent, #3b82f6 );
}

.wpiecal-themes {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 6px;
}

.wpiecal-theme {
	position: relative;
	height: 24px;
	overflow: hidden;
	cursor: pointer;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

.wpiecal-theme.sel {
	border-color: var( --ed-accent, #3b82f6 );
	box-shadow: 0 0 0 1px var( --ed-accent, #3b82f6 );
}

.wpiecal-shapes {
	display: flex;
	gap: 6px;
}

.wpiecal-types {
	display: grid;
	grid-template-columns: repeat( 5, 1fr );
	gap: 6px;
}

.wpiecal-types .wpiecal-shape {
	width: auto;
}

.wpiecal-shape {
	display: grid;
	flex: none;
	place-items: center;
	width: 32px;
	height: 28px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: none;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 6px;
}

.wpiecal-shape:hover {
	color: inherit;
}

.wpiecal-shape.sel {
	color: var( --ed-accent, #3b82f6 );
	border-color: var( --ed-accent, #3b82f6 );
	box-shadow: 0 0 0 1px var( --ed-accent, #3b82f6 );
}

.wpiecal-reset {
	padding: 1px 7px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
	cursor: pointer;
	background: none;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 5px;
}

.wpiecal-reset:hover {
	color: inherit;
	border-color: var( --ed-accent, #3b82f6 );
}

.wpiecal-swatch {
	display: inline-flex;
}

.wpiecal-swatch input[type='color'] {
	width: 30px;
	height: 22px;
	padding: 0;
	cursor: pointer;
	background: none;
	border: 1px solid var( --ed-border, #333a44 );
	border-radius: 5px;
}

.wpiecal-attr {
	margin-top: auto;
	padding-top: 8px;
	font-size: 10px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiecal-text-row {
	margin: 6px 0;
}

.wpiecal-text-row > span {
	display: block;
	margin-bottom: 3px;
	font-size: 11px;
	color: var( --ed-text-muted, #9aa1ab );
}

.wpiecal-pinadd {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 6px;
}

.wpiecal-pin {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 6px;
	align-items: center;
	margin-top: 6px;
}

.wpiecal-hladd {
	grid-template-columns: 1fr 1fr auto;
}

.wpiecal-hl {
	display: grid;
	grid-template-columns: auto auto auto 1fr auto;
	gap: 6px;
	align-items: center;
	margin-top: 6px;
}

.wpiecal-shapebtn {
	width: 24px;
	padding: 1px 0;
	font-size: 12px;
	line-height: 18px;
	text-align: center;
}

.wpiecal-hlname {
	min-width: 0;
}

.wpiecal-side .wpiecal-hlname.dsm-input {
	height: 24px;
	padding: 0 7px;
	font-size: 11px;
}

.wpiecal-hldate {
	font-size: 11px;
	white-space: nowrap;
}

.wpiecal-side textarea.dsm-input {
	height: auto;
	min-height: 70px;
	padding: 7px 11px;
	resize: vertical;
}

/* Text, number and date fields use the editor's .dsm-input primitive
   (correct theme colors and enough specificity against wp-admin form
   styles); only the width is ours. */
.wpiecal-side .dsm-input {
	width: 100%;
	min-width: 0;
}
