/* Note workspace — layout stile Notion compatto */

.prog-note-page__header {
	margin-bottom: 16px;
}

.prog-kbd {
	display: inline-block;
	padding: 2px 8px;
	font-size: 12px;
	font-family: inherit;
	font-weight: 600;
	border: 1px solid var(--prog-gray-300);
	border-radius: 6px;
	background: var(--prog-gray-100);
	color: var(--prog-gray-700);
	vertical-align: middle;
}

/* Menu slash (Notion-like) */
/* Barra flottante formattazione (selezione testo) */
.prog-note-float-toolbar:not([hidden]) {
	display: flex !important;
}

.prog-note-float-toolbar {
	position: fixed;
	z-index: 10061;
	align-items: center;
	gap: 2px;
	padding: 4px 6px;
	background: #fff;
	border: 1px solid var(--prog-gray-200);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.prog-note-float-toolbar__btn {
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border: none;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	font-size: 14px;
	color: var(--prog-gray-800);
	line-height: 1;
	transition: background 0.12s;
}

.prog-note-float-toolbar__btn:hover {
	background: var(--prog-gray-100);
}

.prog-slash-menu:not([hidden]) {
	display: block !important;
}

.prog-slash-menu {
	position: fixed;
	z-index: 10060;
	min-width: 216px;
	max-width: min(248px, 100vw - 16px);
	max-height: min(52vh, 380px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid var(--prog-gray-200);
	border-radius: 8px;
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
	padding: 4px;
}

.prog-slash-menu__hint {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--prog-gray-400);
	padding: 4px 6px 2px;
}

.prog-slash-menu__item {
	display: flex;
	align-items: center;
	gap: 7px;
	width: 100%;
	text-align: left;
	padding: 5px 7px;
	border: none;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	font-size: 12px;
	color: var(--prog-gray-900);
	transition: background 0.12s;
}

.prog-slash-menu__item--with-acc {
	padding-right: 4px;
}

.prog-slash-menu__acc {
	margin-left: auto;
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
	color: var(--prog-gray-400);
	padding: 0 2px;
}

.prog-slash-menu__item:hover,
.prog-slash-menu__item.is-active {
	background: var(--prog-gray-100);
}

.prog-slash-menu__item[hidden] {
	display: none;
}

.prog-slash-menu__icon {
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--prog-gray-100);
	border-radius: 5px;
	font-size: 11px;
	flex-shrink: 0;
}

.prog-slash-menu__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.prog-slash-menu__text strong {
	font-weight: 600;
}

.prog-slash-menu__text small {
	font-size: 10px;
	color: var(--prog-gray-500);
	font-weight: 400;
}

.prog-note-workspace {
	display: grid;
	grid-template-columns: minmax(220px, 280px) 1fr;
	gap: 0;
	min-height: calc(100vh - 220px);
	border: 1px solid var(--prog-gray-200);
	border-radius: var(--prog-radius, 12px);
	overflow: hidden;
	background: var(--prog-gray-50, #fafafa);
}

.prog-note-workspace__sidebar {
	background: #fff;
	border-right: 1px solid var(--prog-gray-200);
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 420px;
}

.prog-note-workspace__toolbar {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* Pulsante import .enex: più visibile nella toolbar */
.prog-note-toolbar-import-enex {
	background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
	color: #fff !important;
	border: 1px solid rgba(30, 64, 175, 0.55) !important;
	box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
	font-weight: 600;
}

.prog-note-toolbar-import-enex:hover {
	filter: brightness(1.06);
}

.prog-note-toolbar-import-enex:focus-visible {
	outline: 2px solid var(--prog-primary, #2563eb);
	outline-offset: 2px;
}

.prog-note-workspace__hint {
	font-size: 12px;
	color: var(--prog-gray-500);
	margin: 0;
}

.prog-note-parent-line {
	display: inline;
}

.prog-note-parent-root {
	border: none;
	background: none;
	padding: 0 2px;
	margin: 0;
	font: inherit;
	font-size: 12px;
	color: var(--prog-primary, #2563eb);
	cursor: pointer;
	text-decoration: underline;
	vertical-align: baseline;
}

.prog-note-parent-root:hover {
	text-decoration: none;
}

.prog-note-parent-root.is-active {
	font-weight: 700;
	color: var(--prog-gray-800);
	text-decoration: none;
	cursor: default;
}

.prog-note-parent-label {
	font-weight: 600;
	color: var(--prog-gray-800);
}

.prog-note-workspace__drop-root {
	font-size: 11px;
	color: var(--prog-gray-400);
	padding: 10px 8px;
	border: 1px dashed var(--prog-gray-300);
	border-radius: 8px;
	text-align: center;
	transition: background 0.15s, border-color 0.15s;
	line-height: 1.35;
}

/* Resta in cima mentre scorri l’albero: così Pluto si può portare a livello Pippo senza perdere la zona */
.prog-note-workspace__drop-root--sticky {
	position: sticky;
	top: 0;
	z-index: 4;
	margin-bottom: 6px;
	background: #fafafa;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.prog-note-workspace__drop-root.prog-note-workspace__drop--over {
	background: #eff6ff;
	border-color: var(--prog-primary, #2563eb);
	color: var(--prog-primary, #2563eb);
}

.prog-note-workspace__tree {
	flex: 1;
	overflow-y: auto;
	font-size: 13px;
	min-height: 120px;
}

.prog-note-tree__row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 6px;
	border-radius: 6px;
	cursor: pointer;
	user-select: none;
	min-height: 32px;
}

.prog-note-tree__row:hover {
	background: var(--prog-gray-100);
}

.prog-note-tree__row.is-active {
	background: #e0ecff;
	color: var(--prog-primary, #1d4ed8);
}

.prog-note-tree__row.prog-note-workspace__drop--over {
	outline: 2px solid var(--prog-primary, #2563eb);
}

.prog-note-tree__drag {
	flex-shrink: 0;
	width: 22px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: grab;
	color: var(--prog-gray-400);
	font-size: 11px;
	line-height: 1;
	letter-spacing: -0.12em;
	user-select: none;
}

.prog-note-tree__drag:active {
	cursor: grabbing;
}

.prog-note-tree__toggle {
	width: 22px;
	height: 22px;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--prog-gray-500);
	flex-shrink: 0;
}

.prog-note-tree__toggle--spacer {
	visibility: hidden;
	pointer-events: none;
}

.prog-note-tree__icon {
	flex-shrink: 0;
	opacity: 0.7;
}

.prog-note-tree__label {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.prog-note-tree__rename,
.prog-note-tree__delete {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	border-radius: 4px;
	color: var(--prog-gray-400);
	font-size: 15px;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.12s, background 0.12s, color 0.12s;
	touch-action: manipulation;
}

.prog-note-tree__row:hover .prog-note-tree__rename,
.prog-note-tree__row:hover .prog-note-tree__delete {
	opacity: 1;
}

.prog-note-tree__rename:hover,
.prog-note-tree__delete:hover {
	background: var(--prog-gray-200);
	color: var(--prog-gray-800);
}

.prog-note-workspace__editor {
	background: #fff;
	padding: 20px 24px;
	min-height: 420px;
}

.prog-note-workspace__empty {
	color: var(--prog-gray-500);
	padding: 40px 20px;
	text-align: center;
	font-size: 14px;
}

.prog-note-workspace__editor-head {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 16px;
}

.prog-note-workspace__title {
	flex: 1;
	font-size: 22px;
	font-weight: 700;
	border: none;
	background: transparent;
	padding: 8px 0;
	border-bottom: 1px solid var(--prog-gray-200);
}

.prog-note-workspace__title:focus {
	outline: none;
	border-bottom-color: var(--prog-primary, #2563eb);
}

.prog-note-share {
	margin-bottom: 16px;
	padding: 12px 14px;
	border: 1px solid var(--prog-gray-200);
	border-radius: 8px;
	background: var(--prog-gray-50);
	font-size: 13px;
}

.prog-note-share__intro {
	margin: 0 0 10px;
	color: var(--prog-gray-600);
	line-height: 1.45;
}

.prog-note-share__code {
	font-size: 0.92em;
	padding: 1px 5px;
	border-radius: 4px;
	background: var(--prog-gray-100);
	color: var(--prog-gray-800);
}

.prog-note-share__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-bottom: 8px;
}

.prog-note-share__label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 500;
	color: var(--prog-gray-800);
}

.prog-note-share__url-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.prog-note-share__url {
	flex: 1;
	min-width: 200px;
	font-size: 12px;
}

.prog-note-workspace__blocks {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.prog-note-block {
	position: relative;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 8px 8px 8px 34px;
	transition: border-color 0.15s, opacity 0.15s;
}

.prog-note-block.is-dragging {
	opacity: 0.55;
}

.prog-note-block__drag {
	position: absolute;
	left: 6px;
	top: 10px;
	z-index: 4;
	width: 22px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: grab;
	color: var(--prog-gray-400);
	font-size: 11px;
	line-height: 1;
	letter-spacing: -0.12em;
	user-select: none;
	opacity: 0;
	transition: opacity 0.15s;
}

.prog-note-block:hover .prog-note-block__drag,
.prog-note-block:focus-within .prog-note-block__drag {
	opacity: 1;
}

.prog-note-block__drag:active {
	cursor: grabbing;
}

.prog-note-block:focus-within {
	border-color: var(--prog-gray-200);
}

.prog-note-block__remove {
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 5;
	opacity: 0;
	border: none;
	background: var(--prog-gray-100);
	width: 24px;
	height: 24px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	pointer-events: auto;
}

.prog-note-block:hover .prog-note-block__remove {
	opacity: 1;
}

.prog-note-blocks__add {
	display: block;
	width: 100%;
	margin-top: 2px;
	padding: 6px 8px;
	border: 1px dashed var(--prog-gray-200);
	border-radius: 6px;
	background: transparent;
	color: var(--prog-gray-400);
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}

.prog-note-blocks__add:hover,
.prog-note-blocks__add:focus-visible {
	opacity: 1;
	color: var(--prog-gray-700);
	border-color: var(--prog-gray-300);
	background: var(--prog-gray-50);
}

.prog-note-block__editor {
	position: relative;
	min-height: 1.5em;
	font-size: 15px;
	line-height: 1.6;
	outline: none;
}

.prog-note-block__editor .prog-note-toc {
	margin: 8px 0;
	padding: 12px 14px;
	background: var(--prog-gray-50);
	border: 1px solid var(--prog-gray-200);
	border-radius: 8px;
	font-size: 14px;
}

.prog-note-toc__title {
	font-weight: 600;
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--prog-gray-600);
}

.prog-note-toc ul {
	margin: 0;
	padding-left: 1.2em;
}

.prog-note-toc a {
	color: var(--prog-primary, #2563eb);
}

.prog-note-block__editor .prog-note-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin: 8px 0;
}

.prog-note-block__editor .prog-note-table td {
	border: 1px solid var(--prog-gray-200);
	padding: 8px 10px;
	min-width: 48px;
}

.prog-note-checklist {
	list-style: none;
	padding-left: 0;
	margin: 8px 0;
}

.prog-note-checklist li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 4px 0;
}

.prog-note-checklist input.prog-note-checkbox {
	margin-top: 4px;
	flex-shrink: 0;
}

.prog-note-inline-cb {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.prog-note-block__editor blockquote {
	margin: 8px 0;
	padding: 8px 12px 8px 16px;
	border-left: 4px solid var(--prog-gray-300);
	background: var(--prog-gray-50);
	color: var(--prog-gray-800);
}

.prog-note-hr {
	border: none;
	border-top: 1px solid var(--prog-gray-200);
	margin: 12px 0;
}

.prog-note-ref {
	padding: 10px 12px;
	background: #f0f6ff;
	border: 1px solid #c7d9f5;
	border-radius: 8px;
	font-size: 14px;
}

.prog-note-ref__link {
	color: var(--prog-primary, #2563eb);
	font-weight: 600;
	text-decoration: none;
}

.prog-note-ref__link:hover {
	text-decoration: underline;
}

.prog-note-event {
	padding: 12px 14px;
	background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
	border: 1px solid #fde68a;
	border-radius: 10px;
	font-size: 14px;
}

.prog-note-event__title {
	margin: 0 0 6px;
	font-weight: 700;
	font-size: 16px;
}

.prog-note-event__date {
	margin: 0 0 8px;
	color: var(--prog-gray-600);
	font-size: 13px;
}

.prog-note-event__desc {
	margin: 0;
	color: var(--prog-gray-800);
	line-height: 1.5;
}

.prog-note-modal-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--prog-gray-600);
	margin: 10px 0 4px;
}

#prog-note-note-link-modal select.prog-form-input,
#prog-note-event-modal textarea.prog-form-input {
	width: 100%;
	box-sizing: border-box;
}

/* Placeholder stile Evernote (solo blocco vuoto) */
.prog-note-block__editor.is-empty::before {
	content: attr(data-placeholder);
	position: absolute;
	left: 0;
	top: 0;
	color: var(--prog-gray-400);
	font-size: 14px;
	font-weight: 400;
	pointer-events: none;
	line-height: 1.6;
	max-width: 100%;
	padding-right: 8px;
}

.prog-note-block__editor h2 {
	font-size: 18px;
	margin: 0 0 8px;
}

.prog-note-block--heading.prog-note-block--h2 .prog-note-block__editor {
	font-size: 20px;
	font-weight: 700;
}

.prog-note-block--heading.prog-note-block--h2 .prog-note-block__editor h2 {
	font-size: 1.35em;
	font-weight: 700;
	margin: 0 0 8px;
}

.prog-note-block--heading.prog-note-block--h3 .prog-note-block__editor {
	font-size: 17px;
	font-weight: 600;
}

.prog-note-block--heading.prog-note-block--h3 .prog-note-block__editor h3 {
	font-size: 1.15em;
	font-weight: 600;
	margin: 0 0 6px;
}

.prog-note-block--heading.prog-note-block--h1 .prog-note-block__editor {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
}

.prog-note-block--heading.prog-note-block--h1 .prog-note-block__editor h1 {
	font-size: 1.25em;
	font-weight: 800;
	margin: 0 0 10px;
}

.prog-note-block--heading.prog-note-block--h4 .prog-note-block__editor {
	font-size: 16px;
	font-weight: 600;
}

.prog-note-block--heading.prog-note-block--h4 .prog-note-block__editor h4 {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 6px;
}

.prog-note-block--heading.prog-note-block--h5 .prog-note-block__editor {
	font-size: 15px;
	font-weight: 600;
}

.prog-note-block--heading.prog-note-block--h5 .prog-note-block__editor h5 {
	font-size: 1em;
	font-weight: 600;
	margin: 0 0 5px;
}

.prog-note-block--heading.prog-note-block--h6 .prog-note-block__editor {
	font-size: 14px;
	font-weight: 600;
	color: var(--prog-gray-700);
}

.prog-note-block--heading.prog-note-block--h6 .prog-note-block__editor h6 {
	font-size: 0.95em;
	font-weight: 600;
	margin: 0 0 4px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.prog-note-block--variant-bold .prog-note-block__editor {
	font-weight: 700;
}

.prog-note-block--variant-italic .prog-note-block__editor {
	font-style: italic;
}

.prog-note-block--variant-uppercase .prog-note-block__editor {
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.prog-note-block--variant-bold-uppercase .prog-note-block__editor {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.prog-note-block--variant-strike .prog-note-block__editor {
	text-decoration: line-through;
	opacity: 0.92;
}

.prog-note-block--embed {
	border: 1px solid var(--prog-gray-200);
	background: var(--prog-gray-50);
}

.prog-note-block--embed-image {
	width: fit-content;
	max-width: 100%;
}

.prog-note-block--embed-image.prog-note-block--embed-align-left {
	margin-left: 0;
	margin-right: auto;
}

.prog-note-block--embed-image.prog-note-block--embed-align-center {
	margin-left: auto;
	margin-right: auto;
}

.prog-note-block--embed-image.prog-note-block--embed-align-right {
	margin-left: auto;
	margin-right: 0;
}

.prog-note-block--embed-image .prog-note-embed {
	display: block;
	width: 100%;
}

.prog-note-embed__align {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	margin-top: 8px;
}

.prog-note-embed__align-btn {
	margin: 0;
	padding: 4px 8px;
	border: 1px solid var(--prog-gray-200);
	border-radius: 6px;
	background: var(--prog-white, #fff);
	color: var(--prog-gray-600);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.prog-note-embed__align-btn:hover {
	border-color: var(--prog-gray-300);
	color: var(--prog-gray-800);
	background: var(--prog-gray-50);
}

.prog-note-embed__align-btn.is-active {
	border-color: var(--prog-gray-500);
	background: var(--prog-gray-100);
	color: var(--prog-gray-900);
}

/* Immagini nel testo (es. import .enex): stesso comportamento di larghezza/maniglia dei blocchi embed */
.prog-note-block__editor .prog-note-img-resize-wrap {
	position: relative;
	display: inline-block;
	max-width: 100%;
	vertical-align: middle;
	box-sizing: border-box;
}

.prog-note-block__editor .prog-note-img-resize-wrap img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
	background: var(--prog-gray-200);
}

.prog-note-embed__img-wrap {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	vertical-align: top;
}

.prog-note-embed__img-wrap .prog-note-embed__media {
	width: 100%;
	height: auto;
}

.prog-note-embed__resize-handle {
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 20px;
	height: 20px;
	border-radius: 6px 0 8px 0;
	background: rgba(0, 0, 0, 0.45);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	cursor: nwse-resize;
	z-index: 2;
	touch-action: none;
}

.prog-note-embed__resize-handle::after {
	content: '';
	position: absolute;
	inset: 5px;
	border-right: 2px solid rgba(255, 255, 255, 0.9);
	border-bottom: 2px solid rgba(255, 255, 255, 0.9);
	pointer-events: none;
}

.prog-note-embed__resize-handle:hover {
	background: rgba(0, 0, 0, 0.6);
}

.prog-note-embed__media {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
	background: var(--prog-gray-200);
}

video.prog-note-embed__media {
	max-height: min(70vh, 520px);
}

.prog-note-embed__card {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.prog-note-embed__thumb {
	width: 120px;
	height: 68px;
	object-fit: cover;
	border-radius: 8px;
	background: var(--prog-gray-200);
	flex-shrink: 0;
}

.prog-note-embed__body {
	flex: 1;
	min-width: 0;
}

.prog-note-embed__title {
	font-weight: 600;
	font-size: 14px;
	margin: 0 0 4px;
}

.prog-note-embed__meta {
	font-size: 12px;
	color: var(--prog-gray-500);
	margin: 0;
}

.prog-note-embed__frame-wrap {
	margin-top: 10px;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16/9;
	max-width: 100%;
}

.prog-note-embed__frame-wrap iframe {
	width: 100%;
	height: 100%;
	min-height: 200px;
	border: 0;
	display: block;
}

.prog-note-embed__pdf {
	margin-top: 10px;
	height: min(70vh, 520px);
	border: 1px solid var(--prog-gray-200);
	border-radius: 8px;
	overflow: hidden;
}

.prog-note-embed__pdf iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.prog-note-workspace__save-hint {
	font-size: 12px;
	color: var(--prog-gray-400);
	margin-top: 16px;
	min-height: 1.2em;
}

/* Modal embed + cartella + import enex + altri */
#prog-note-embed-modal[hidden],
#prog-note-folder-modal[hidden],
#prog-note-note-link-modal[hidden],
#prog-note-event-modal[hidden],
#prog-note-enex-import-modal[hidden] {
	display: none !important;
}

#prog-note-embed-modal:not([hidden]),
#prog-note-folder-modal:not([hidden]),
#prog-note-note-link-modal:not([hidden]),
#prog-note-event-modal:not([hidden]),
#prog-note-enex-import-modal:not([hidden]) {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.prog-note-embed-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.prog-note-embed-modal__panel {
	position: relative;
	background: #fff;
	border-radius: 12px;
	padding: 20px;
	max-width: 420px;
	width: 100%;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
	z-index: 1;
}

.prog-note-embed-modal__panel .prog-modal__title {
	margin: 0 0 8px;
	font-size: 18px;
}

.prog-note-embed-modal__text {
	font-size: 13px;
	color: var(--prog-gray-600);
	margin: 0 0 12px;
}

.prog-note-embed-modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}

/* Modal import Evernote (.enex) */
.prog-note-enex-modal__progress {
	height: 10px;
	border-radius: 999px;
	background: var(--prog-gray-200);
	overflow: hidden;
	margin: 4px 0 12px;
}

.prog-note-enex-modal__progress-fill {
	height: 100%;
	width: 0%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--prog-primary, #2563eb), #93c5fd);
	transition: width 0.25s ease;
}

.prog-note-enex-modal__detail {
	font-size: 13px;
	color: var(--prog-gray-600);
	margin: 0 0 8px;
	line-height: 1.45;
}

.prog-note-enex-modal__detail--error {
	color: #b91c1c;
}

.prog-note-enex-import-modal__actions {
	margin-top: 8px;
}

@media (max-width: 900px) {
	.prog-note-workspace {
		grid-template-columns: 1fr;
	}

	.prog-note-workspace__sidebar {
		border-right: none;
		border-bottom: 1px solid var(--prog-gray-200);
		min-height: auto;
		max-height: 40vh;
	}
}

/* Smartphone: editor leggibile, niente overflow orizzontale, altezza workspace naturale */
@media (max-width: 767px) {
	.prog-note-workspace {
		min-height: 0;
		border-radius: 10px;
		grid-template-columns: 1fr;
	}

	.prog-note-workspace__sidebar {
		max-height: min(38vh, 320px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 10px;
	}

	.prog-note-workspace__toolbar {
		gap: 6px;
	}

	.prog-note-workspace__toolbar .prog-btn {
		font-size: 12px;
		padding: 6px 10px;
	}

	.prog-note-workspace__editor {
		min-height: 0;
		padding: 12px 12px 20px;
		overflow-x: hidden;
		max-width: 100%;
		-webkit-text-size-adjust: 100%;
	}

	.prog-note-workspace__editor-inner {
		max-width: 100%;
		overflow-x: hidden;
	}

	.prog-note-workspace__editor-head {
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 8px;
		margin-bottom: 12px;
	}

	.prog-note-workspace__title {
		order: -1;
		flex: 1 1 100%;
		min-width: 0;
		width: 100%;
		font-size: 1.25rem;
		padding: 6px 0;
	}

	#prog-note-print,
	#prog-note-delete {
		flex: 0 0 auto;
	}

	.prog-note-share {
		padding: 10px 12px;
		font-size: 12px;
	}

	.prog-note-share__intro {
		font-size: 12px;
		line-height: 1.4;
		word-wrap: break-word;
		overflow-wrap: anywhere;
	}

	.prog-note-share__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.prog-note-share__url-row {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.prog-note-share__url {
		min-width: 0;
		width: 100%;
		max-width: 100%;
		font-size: 11px;
		word-break: break-all;
	}

	.prog-note-share__url-row .prog-btn {
		width: 100%;
		justify-content: center;
	}

	.prog-note-workspace__blocks {
		max-width: 100%;
		overflow-x: hidden;
	}

	.prog-note-block {
		padding-left: 8px;
		padding-right: 6px;
		max-width: 100%;
	}

	.prog-note-block__drag {
		left: 2px;
		opacity: 0.45;
		touch-action: manipulation;
	}

	.prog-note-block__remove {
		opacity: 0.65;
		touch-action: manipulation;
	}

	.prog-note-block__editor {
		font-size: 16px;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.prog-note-block__editor table.prog-note-table {
		max-width: 100%;
	}

	.prog-note-embed__card,
	.prog-note-embed__frame-wrap,
	.prog-note-embed__img-wrap {
		max-width: 100%;
	}

	.prog-note-embed__frame-wrap iframe {
		max-width: 100%;
	}

	video.prog-note-embed__media {
		max-width: 100%;
		height: auto;
	}

	.prog-note-blocks__add {
		padding: 10px;
		font-size: 20px;
		touch-action: manipulation;
	}
}

/* Stampa / PDF (browser: Stampa → Salva come PDF): solo contenuto nota, senza controlli editor */
@media print {
	@page {
		margin: 1.2cm;
	}

	.prog-app .prog-sidebar,
	.prog-app .prog-layout-resizer,
	.prog-app .prog-header-mobile,
	.prog-app .prog-bottom-nav,
	.prog-app .prog-modal-overlay {
		display: none !important;
	}

	.prog-main {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.prog-note-page__header,
	.prog-note-workspace__sidebar,
	.prog-note-workspace__toolbar,
	.prog-note-workspace__hint,
	.prog-note-workspace__tree,
	.prog-note-workspace__drop-root,
	.prog-note-workspace__save-hint,
		#prog-note-delete,
		#prog-note-print,
		#prog-note-share-wrap,
		.prog-note-embed__align,
	.prog-note-embed__resize-handle,
	.prog-note-block__drag,
	.prog-note-block__remove,
	.prog-note-blocks__add,
	.prog-note-float-toolbar,
	#prog-slash-menu,
	.prog-note-media-input,
	.prog-modal {
		display: none !important;
	}

	.prog-note-workspace {
		display: block !important;
	}

	.prog-note-workspace__editor {
		width: 100% !important;
		max-width: none !important;
		border: none !important;
		box-shadow: none !important;
	}

	.prog-note-workspace__editor-inner[hidden] {
		display: none !important;
	}

	.prog-note-workspace__editor-inner:not([hidden]) {
		display: block !important;
	}

	.prog-note-workspace__editor-head {
		display: block !important;
		margin-bottom: 12px !important;
	}

	.prog-note-workspace__title {
		border: none !important;
		box-shadow: none !important;
		background: transparent !important;
		font-size: 22pt !important;
		font-weight: 700 !important;
		padding: 0 !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.prog-note-block {
		padding-left: 8px !important;
		padding-right: 8px !important;
		border-color: transparent !important;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.prog-note-block--embed {
		border: none !important;
		background: transparent !important;
	}

	.prog-note-block__editor {
		border: none !important;
	}
}
