/* Planning Studio — les couleurs se personnalisent via les variables ci-dessous. */
.pstudio {
	--pstudio-accent: #1d1d1f;
	--pstudio-accent-text: #fff;
	--pstudio-free: #e7f4ea;
	--pstudio-free-border: #9fd0ac;
	--pstudio-free-text: #17572d;
	--pstudio-booked: #f3e3e3;
	--pstudio-booked-text: #9b4a4a;
	--pstudio-closed: #f2f2f2;
	--pstudio-closed-text: #a8a8a8;
	--pstudio-border: #e2e2e2;
	--pstudio-radius: 8px;
	--pstudio-width: 1100px;
	--pstudio-cols: 5;
	font-size: 15px;
	line-height: 1.4;
}
/* Sort de la colonne de texte du thème pour profiter de la largeur de l'écran
   (sélecteur renforcé + !important : les thèmes blocs imposent largeur et marges). */
.pstudio[data-pstudio] {
	--pstudio-w: min(var(--pstudio-width), calc(100vw - 48px));
	width: var(--pstudio-w) !important;
	max-width: none !important;
	margin-left: calc(50% - var(--pstudio-w) / 2) !important;
	margin-right: 0 !important;
}
.pstudio *, .pstudio *::before, .pstudio *::after { box-sizing: border-box; }

.pstudio-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.pstudio .pstudio-title { margin: 0; font-size: 1.15em; text-align: center; }
.pstudio .pstudio-nav button {
	appearance: none; width: 40px; height: 40px; padding: 0; flex: none;
	border: 1px solid var(--pstudio-border); border-radius: 50%;
	background: #fff; color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
	box-shadow: none; text-transform: none;
}
.pstudio .pstudio-nav button:disabled { opacity: .3; cursor: default; }

.pstudio-rate { text-align: center; margin: 4px 0 10px; color: #555; }
.pstudio-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 14px; font-size: .85em; color: #555; }
.pstudio-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pstudio-legend i.is-free { background: var(--pstudio-free); border: 1px solid var(--pstudio-free-border); }
.pstudio-legend i.is-booked { background: var(--pstudio-booked); }
.pstudio-legend i.is-closed { background: var(--pstudio-closed); }

.pstudio-grid { display: grid; grid-template-columns: repeat(var(--pstudio-cols), minmax(0, 1fr)); gap: 8px; transition: opacity .15s; }
.pstudio-grid.is-loading { opacity: .45; pointer-events: none; }
.pstudio-day { border: 1px solid var(--pstudio-border); border-radius: var(--pstudio-radius); padding: 8px; background: #fff; }
.pstudio-day-head { text-align: center; margin-bottom: 8px; }
.pstudio-dow { display: block; font-weight: 600; }
.pstudio-dm { display: block; font-size: .85em; color: #666; }
.pstudio-block { display: grid; gap: 4px; }
.pstudio-break { text-align: center; font-size: .72em; text-transform: uppercase; letter-spacing: .06em; color: #aaa; padding: 6px 0; }

.pstudio .pstudio-slot {
	appearance: none; display: block; width: 100%; min-height: 34px; margin: 0; padding: 6px 4px;
	border: 1px solid transparent; border-radius: 6px; box-shadow: none;
	font: inherit; font-size: .85em; line-height: 1.2; text-align: center; text-transform: none; letter-spacing: normal;
	cursor: pointer; transition: background .12s, color .12s;
}
.pstudio .pstudio-slot.is-free { background: var(--pstudio-free); border-color: var(--pstudio-free-border); color: var(--pstudio-free-text); }
.pstudio .pstudio-slot.is-free:hover { filter: brightness(.95); }
.pstudio .pstudio-slot.is-booked { background: var(--pstudio-booked); color: var(--pstudio-booked-text); text-decoration: line-through; cursor: not-allowed; }
.pstudio .pstudio-slot.is-closed { background: var(--pstudio-closed); color: var(--pstudio-closed-text); cursor: not-allowed; }
.pstudio .pstudio-slot.is-selected { background: var(--pstudio-accent); border-color: var(--pstudio-accent); color: var(--pstudio-accent-text); }
.pstudio .pstudio-slot:focus-visible { outline: 2px solid var(--pstudio-accent); outline-offset: 2px; }

.pstudio-empty { grid-column: 1 / -1; text-align: center; padding: 24px; color: #666; }

.pstudio-form-wrap { margin-top: 20px; border: 1px solid var(--pstudio-border); border-radius: var(--pstudio-radius); padding: 18px; background: #fafafa; }
.pstudio-summary { margin: 0 0 14px; font-weight: 600; font-size: 1.05em; }
.pstudio-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pstudio-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .9em; margin: 0; }
.pstudio-fields .pstudio-full { grid-column: 1 / -1; }
.pstudio-fields input, .pstudio-fields select, .pstudio-fields textarea {
	width: 100%; max-width: none; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font: inherit; background: #fff; color: inherit;
}
.pstudio-fields label.pstudio-check { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--pstudio-border); border-radius: 6px; background: #fff; cursor: pointer; font-size: .95em; }
.pstudio-fields .pstudio-check input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; padding: 0; accent-color: var(--pstudio-accent); }
.pstudio-fields .pstudio-extras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pstudio-extras legend { padding: 0; margin-bottom: 4px; font-size: .9em; }
.pstudio-extras legend small { color: #666; }
.pstudio-check small { display: block; margin-top: 2px; font-size: .85em; color: #666; }
.pstudio-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pstudio-total { margin: 16px 0 0; font-size: 1.05em; }
.pstudio-total small { color: #666; }
.pstudio-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pstudio .pstudio-actions button { appearance: none; padding: 10px 18px; border-radius: 6px; font: inherit; cursor: pointer; text-transform: none; box-shadow: none; }
.pstudio .pstudio-submit { background: var(--pstudio-accent); color: var(--pstudio-accent-text); border: 1px solid var(--pstudio-accent); font-weight: 600; }
.pstudio .pstudio-submit:disabled { opacity: .6; cursor: wait; }
.pstudio .pstudio-cancel { background: transparent; color: inherit; border: 1px solid #ccc; }
.pstudio-small { margin: 12px 0 0; font-size: .82em; color: #666; }

.pstudio-notice { margin-top: 16px; padding: 12px 14px; border-radius: var(--pstudio-radius); }
.pstudio-notice.is-success { background: #e7f4ea; color: #17572d; border: 1px solid #9fd0ac; }
.pstudio-notice.is-error { background: #fbeaea; color: #8a1f1f; border: 1px solid #e6b3b3; }

@media (max-width: 560px) {
	.pstudio-grid { grid-template-columns: 1fr; }
	.pstudio-day { display: grid; grid-template-columns: 78px 1fr; gap: 6px 10px; align-items: start; }
	.pstudio-day-head { grid-row: span 3; text-align: left; margin: 4px 0 0; }
	.pstudio-block { grid-template-columns: repeat(4, 1fr); }
	.pstudio-break { padding: 0; font-size: 0; height: 2px; }
	.pstudio .pstudio-slot { font-size: .78em; padding: 6px 2px; }
	.pstudio-fields, .pstudio-fields .pstudio-extras { grid-template-columns: 1fr; }
}
