/* ==========================================================================
   Kube Office - Landing: sezione "Demo dimostrativa" e modale del simulatore.
   Il simulatore ([kube_office_demo]) ha i suoi stili (kod-app); qui solo il contorno.
   ========================================================================== */

.ko-demo {
	--ko-demo-accent: #f47a20;
	--ko-demo-accent-ink: #c2410c;
	--ko-demo-ink: #111518;
	--ko-demo-muted: #5a6068;
	--ko-demo-line: #e6e1db;
	max-width: 1080px;
	margin: 0 auto;
}

/* --------------------------------------------------------------- anteprima */
.ko-demo__preview {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
}
.ko-demo__preview:focus-visible { outline: 3px solid var(--ko-demo-accent); outline-offset: 6px; }

.ko-demo__window {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--ko-demo-line);
	border-radius: 18px;
	background: #eef0f1;
	box-shadow: 0 40px 80px -40px rgba(17, 21, 24, 0.45), 0 2px 6px rgba(17, 21, 24, 0.06);
	font-family: "DM Sans", "Inter", system-ui, sans-serif;
	font-size: 12px;
	color: var(--ko-demo-ink);
	transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.ko-demo__preview:hover .ko-demo__window,
.ko-demo__preview:focus-visible .ko-demo__window {
	transform: translateY(-3px);
	box-shadow: 0 50px 90px -40px rgba(17, 21, 24, 0.55), 0 2px 6px rgba(17, 21, 24, 0.06);
	filter: saturate(1.05);
}

.ko-demo__top {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 46px;
	padding: 0 16px;
	background: #fff;
	border-bottom: 1px solid #e3e5e7;
}
.ko-demo__brand { display: inline-flex; align-items: center; font-size: 16px; font-weight: 800; letter-spacing: -0.03em; }
.ko-demo__cube {
	width: 12px;
	height: 12px;
	margin: 0 1px 0 2px;
	border-radius: 3px;
	background: var(--ko-demo-accent);
	box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 4px var(--ko-demo-accent);
}
.ko-demo__crumb { padding-left: 14px; border-left: 1px solid #e3e5e7; color: #3d4046; }
.ko-demo__pills { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.ko-demo__pill { padding: 3px 9px; border: 1.5px solid #3d4046; border-radius: 99px; font-size: 10.5px; font-weight: 600; }
.ko-demo__pill--ok { border-color: transparent; background: #e3f4e8; color: #1b6b35; }
.ko-demo__avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef0f1; font-size: 10px; font-weight: 700; }

.ko-demo__body { display: flex; min-height: 0; }
.ko-demo__side {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: none;
	width: 168px;
	padding: 16px 10px;
	background: #16191c;
}
.ko-demo__nav { padding: 8px 12px; border-radius: 8px; color: #e9eaec; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ko-demo__nav.is-active { background: var(--ko-demo-accent); color: #fff; }

.ko-demo__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
.ko-demo__h { font-size: 19px; font-weight: 500; }
.ko-demo__drop { padding: 13px 14px; border: 1.5px dashed #cfd3d7; border-radius: 12px; background: #fff; color: var(--ko-demo-muted); }
.ko-demo__cats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	padding: 12px;
	border-radius: 12px;
	background: #fff;
}
.ko-demo__cat {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border: 1px solid #f6b98a;
	border-radius: 9px;
	background: #fff4ec;
	font-weight: 600;
	font-size: 11px;
	line-height: 1.25;
}
.ko-demo__check {
	position: relative;
	flex: none;
	width: 13px;
	height: 13px;
	border-radius: 3px;
	background: var(--ko-demo-accent);
}
.ko-demo__check::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1.5px;
	width: 3.5px;
	height: 7px;
	border: solid #fff;
	border-width: 0 1.6px 1.6px 0;
	transform: rotate(45deg);
}
.ko-demo__actions { display: flex; justify-content: flex-end; }
.ko-demo__btn { padding: 8px 18px; border-radius: 99px; background: var(--ko-demo-accent); color: #fff; font-weight: 700; }

.ko-demo__play {
	position: absolute;
	left: 50%;
	top: 50%;
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	margin: -62px 0 0 -42px;
	border-radius: 50%;
	background: var(--ko-demo-accent);
	color: #fff;
	box-shadow: 0 0 0 12px rgba(244, 122, 32, 0.22), 0 20px 40px -12px rgba(194, 65, 12, 0.6);
	transition: transform 0.2s ease;
}
.ko-demo__play svg { margin-left: 4px; }
.ko-demo__cta {
	position: absolute;
	left: 50%;
	top: 50%;
	margin-top: 36px;
	padding: 9px 20px;
	border-radius: 99px;
	background: var(--ko-demo-ink);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	white-space: nowrap;
	transform: translateX(-50%);
	box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6);
}
.ko-demo__preview:hover .ko-demo__play,
.ko-demo__preview:focus-visible .ko-demo__play { transform: scale(1.07); }

/* -------------------------------------------------------------- scorciatoie */
.ko-demo__lead { margin: 34px 0 14px; text-align: center; font-weight: 600; color: var(--ko-demo-ink); }
.ko-demo__shortcuts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ko-demo__shortcuts li { margin: 0; padding: 0; }
.ko-demo__shortcut {
	display: flex;
	flex-direction: column;
	gap: 3px;
	width: 100%;
	height: 100%;
	padding: 14px 16px;
	border: 1px solid var(--ko-demo-line);
	border-radius: 12px;
	background: #fff;
	color: var(--ko-demo-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.ko-demo__shortcut strong { font-size: 1rem; }
.ko-demo__shortcut span { color: var(--ko-demo-muted); font-size: 0.88rem; line-height: 1.4; }
.ko-demo__shortcut:hover { border-color: var(--ko-demo-accent); background: #fff8f2; transform: translateY(-2px); }
.ko-demo__shortcut:focus-visible { outline: 3px solid var(--ko-demo-accent); outline-offset: 2px; }
.ko-demo__note { margin: 18px 0 0; text-align: center; font-size: 0.85rem; color: var(--ko-demo-muted); }
.ko-demo__missing { padding: 14px 18px; border-radius: 10px; background: #fff4ec; color: #7c2d0a; }

/* ----------------------------------------------------------------- modale */
html.ko-demo-open { overflow: hidden; }

.ko-demo-dialog {
	width: min(1320px, 96vw);
	height: min(920px, 94vh);
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: #f4f5f6;
	color: var(--ko-demo-ink, #111518);
	overflow: hidden;
	box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.6);
}
.ko-demo-dialog[open] { display: flex; flex-direction: column; animation: ko-demo-in 0.2s ease; }
.ko-demo-dialog::backdrop { background: rgba(8, 10, 12, 0.72); backdrop-filter: blur(3px); }

.ko-demo-dialog__head {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: none;
	min-height: 60px;
	padding: 10px 14px 10px 22px;
	background: #111518;
	color: #fff;
}
.ko-demo-dialog__title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.ko-demo-dialog__title:focus { outline: none; }
.ko-demo-dialog__hint { color: rgba(255, 255, 255, 0.66); font-size: 0.85rem; }
.ko-demo-dialog__cta {
	margin-left: auto;
	padding: 8px 16px;
	border-radius: 99px;
	background: #c2410c;
	color: #fff !important;
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none !important;
	white-space: nowrap;
}
.ko-demo-dialog__cta:hover { background: #9a3412; }
.ko-demo-dialog__close {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.ko-demo-dialog__close:hover { background: rgba(255, 255, 255, 0.1); }
.ko-demo-dialog__cta:focus-visible,
.ko-demo-dialog__close:focus-visible { outline: 3px solid #f47a20; outline-offset: 2px; }

.ko-demo-dialog__app { flex: 1; min-height: 0; display: flex; padding: 14px; }

/* Il simulatore riempie la modale (al posto dell'altezza fissa dello shortcode). */
.ko-demo-dialog .kod-app { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; margin: 0; }
.ko-demo-dialog .kod-frame { flex: 1 1 auto; height: auto; min-height: 0; }
/* Titoli di schermata: <h1> riscritti in <h2> lato server, stesso aspetto dell'originale. */
.ko-demo-dialog .kod-app [data-kod-h1] { font-size: 22px; font-weight: 500; }

@keyframes ko-demo-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (max-width: 900px) {
	.ko-demo__side { width: 132px; }
	.ko-demo__cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ko-demo__cat:nth-child(n+7) { display: none; }
	.ko-demo__shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ko-demo-dialog__hint { display: none; }
}
@media (max-width: 600px) {
	.ko-demo__side, .ko-demo__pills, .ko-demo__crumb { display: none; }
	.ko-demo__cats { grid-template-columns: 1fr; }
	.ko-demo__cat:nth-child(n+4) { display: none; }
	.ko-demo__shortcuts { grid-template-columns: 1fr; }
	.ko-demo__play { width: 68px; height: 68px; margin: -50px 0 0 -34px; }
	.ko-demo-dialog { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
	.ko-demo-dialog__head { padding-left: 16px; }
	.ko-demo-dialog__cta { display: none; }
	.ko-demo-dialog__close { margin-left: auto; }
	.ko-demo-dialog__app { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.ko-demo__window, .ko-demo__play, .ko-demo__shortcut { transition: none; }
	.ko-demo-dialog[open] { animation: none; }
}
