/* Notes beside a tutorial (inc/notes.php, assets/notes.js) */
/* Stacking: above back-to-top (800) and the header (1000), below the search overlay (10040).
   Left of back-to-top, which sits 1.25rem from the corner and is 3rem wide. */
.em-notes-open {
	position: fixed; right: calc(1.25rem + 3rem + 12px); bottom: 1.25rem; z-index: 850;
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
	/* --em-primary and --em-on-primary are the pair made for a fill and its text, in both modes */
	background: var(--em-primary, #14315b); color: var(--em-on-primary, #fff);
	font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
}
.em-notes-open:focus-visible { outline: 3px solid var(--em-accent, #f5a524); outline-offset: 2px; }
.em-notes-badge {
	min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
	background: var(--em-on-primary, #fff); color: var(--em-primary, #14315b);
	font-size: 12px; line-height: 22px; text-align: center;
}
.em-notes-badge[hidden] { display: none; }

.em-notes-panel {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100;
	width: min(420px, 100vw); display: flex; flex-direction: column;
	background: var(--em-bg-card, #fff); color: var(--em-text, #0f172a);
	border-left: 1px solid var(--em-border, #e2e8f0);
	box-shadow: -12px 0 32px rgba(15, 23, 42, .18);
}
.em-notes-panel[hidden] { display: none; }
.em-notes-head {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--em-border, #e2e8f0);
}
.em-notes-head strong { font-size: 15px; }
.em-notes-close {
	width: 44px; height: 44px; border: 0; border-radius: 10px; background: none;
	color: inherit; font-size: 26px; line-height: 1; cursor: pointer;
}
.em-notes-close:hover { background: var(--em-border, #e2e8f0); }
.em-notes-panel iframe { flex: 1; width: 100%; border: 0; background: var(--em-bg-card, #fff); }

/* The button on a selected sentence */
.em-notes-chip {
	position: absolute; z-index: 1050;
	min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
	background: var(--em-text, #0f172a); color: var(--em-bg-card, #fff);
	font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
	box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
}
.em-notes-chip[hidden] { display: none; }

/* Phones: the panel rises from the bottom, and the button keeps clear of it */
@media (max-width: 640px) {
	.em-notes-panel { top: auto; width: 100vw; height: 78vh; border-left: 0; border-top: 1px solid var(--em-border, #e2e8f0); border-radius: 16px 16px 0 0; }
	.em-notes-open { right: calc(1.25rem + 3rem + 8px); bottom: 1.25rem; }
	.em-notes-on .em-notes-open { display: none; }
}
@media print { .em-notes-open, .em-notes-panel, .em-notes-chip { display: none !important; } }
