/* ===== Lezioni – aree di lavoro: Mappa (MapView), Lavagna, Mappa mentale, Cronologia ===== */

.mv { --mv-h: max(70vh, 540px); display: flex; flex-direction: column; min-height: 0; position: relative; }
.ws .mv, main.ws .mv { height: 100%; }
/* toolbar: una riga, gruppi di icone, scorrimento orizzontale se non c'e' spazio */
.mv-bar { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); overflow-x: auto; overflow-y: visible; scrollbar-width: none; flex: 0 0 auto; min-height: 50px; z-index: 5; }
.mv-bar::-webkit-scrollbar { display: none; }
.card .mv-bar, .mv-card .mv-bar { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; }
.mv-left, .mv-tools { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; flex: 0 0 auto; }
.mv-tools { margin-left: auto; }
.mv-seg button { white-space: nowrap; }
.mv-group { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); flex: 0 0 auto; }
.mv-group > * { border: none !important; border-radius: 0 !important; }
.mv-group > * + * { border-left: 1px solid var(--line) !important; }
.mv-ic { padding: 6px 9px; font-size: var(--fs-sm); line-height: 1.2; min-width: 34px; height: 34px; justify-content: center; border-radius: var(--r); white-space: nowrap; }
.mv-ic .lucide { width: 17px; height: 17px; }
.mv-ic.active { color: var(--accent-fg); background: var(--accent-bg); }
a.mv-ic { display: inline-flex; }
.mv-pct { font-family: var(--mono); font-size: var(--fs-xs); padding: 0 6px; min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.mv-lv { padding: 6px 10px; font-size: var(--fs-sm); }
.mv-lv.active { background: var(--accent-bg) !important; color: var(--accent-fg); font-weight: 600; }
.mv-search { position: relative; display: flex; align-items: center; flex: 0 1 240px; min-width: 150px; }
.mv-search .lucide { position: absolute; left: 9px; color: var(--muted); width: 15px; height: 15px; pointer-events: none; }
.mv-search input { width: 100%; padding: 7px 34px 7px 30px; border-radius: var(--r); font-size: var(--fs-sm); }
.mv-qn { position: absolute; right: 10px; font-size: var(--fs-xs); color: var(--muted); font-family: var(--mono); pointer-events: none; }
.mv-menu { position: relative; flex: 0 0 auto; }
.mv-menu-list { position: absolute; right: 0; top: 40px; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; gap: 2px; min-width: 230px; animation: popin var(--dur) var(--ease); }
.mv-menu-list button, .mv-menu-list a { border: none; text-align: left; padding: 8px 10px; border-radius: var(--r-sm); background: none; display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 500; }
.mv-menu-list button:hover, .mv-menu-list a:hover { background: var(--accent-bg); color: var(--accent-fg); text-decoration: none; }
.mv-menu-list .mv-mtitle { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 2px; font-weight: 700; }
.mv-menu-list hr { border: none; border-top: 1px solid var(--line); margin: 3px 0; }
.mv-menu-list .lucide { color: var(--muted); width: 16px; height: 16px; }
.mv-menu-list button.active { background: var(--accent-bg); color: var(--accent-fg); }
.mv-tourlbl { display: inline; }
@media (max-width: 1500px) { .mv-tourlbl { display: none; } }

/* corpo: canvas + drawer */
.mv-body { flex: 1; min-height: 0; display: flex; align-items: stretch; position: relative; }
.card .mv-body, .mv-card .mv-body { height: var(--mv-h); }
.mv-canvas { flex: 1; min-width: 0; position: relative; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.3px); background-size: 22px 22px; }
.card .mv-canvas, .mv-card .mv-canvas { border: 1px solid var(--line); border-radius: var(--r-md); }
.mv-canvas svg.markmap { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: transparent; border: none; color: var(--text); --markmap-text-color: var(--text); --markmap-font: 400 14px/1.35 var(--font); --markmap-circle-open-bg: var(--card); cursor: grab; }
.mv-canvas svg.markmap:active { cursor: grabbing; }
.mv-canvas svg.markmap:focus { outline: none; }
.mv-canvas:focus-within { box-shadow: inset 0 0 0 2px var(--accent-ring); }
.mv-hint { position: absolute; left: 12px; bottom: 10px; font-size: 11.5px; color: var(--muted); background: color-mix(in srgb, var(--card) 88%, transparent); padding: 4px 9px; border-radius: 7px; pointer-events: none; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-panel { width: 360px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 12px; border-left: 1px solid var(--line); background: var(--card); transition: width var(--dur-slow) var(--ease), padding var(--dur-slow); }
.card .mv-panel, .mv-card .mv-panel { border: none; background: transparent; padding: 0 0 0 12px; max-height: var(--mv-h); }
.mv.nopanel .mv-panel { width: 0; padding: 0; border: none; overflow: hidden; }
.mv-sec { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--card-2); }
.mv-sec h4, .mv-sec summary { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.mv-sec.mv-legend summary { margin: 0; }
.mv-legend ul { list-style: none; margin: 8px 0 0; padding: 0; }
.mv-legend li { font-size: var(--fs-sm); margin: 4px 0; }
.mv-emoji { display: inline-block; width: 24px; font-size: 15px; }
.mv-title { font-weight: 700; font-size: var(--fs-md); margin-bottom: 6px; line-height: 1.3; }
.mv-desc p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; max-width: 65ch; }
.mv-subtitle { color: var(--muted); font-size: 13px; line-height: 1.4; margin: -2px 0 8px; }
.mv-sub { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; font-weight: 700; }
.mv-lessons, .mv-kids { margin: 0; padding-left: 18px; }
.mv-lessons li, .mv-kids li { margin: 4px 0; font-size: var(--fs-sm); line-height: 1.4; }
.mv-mini { font-size: var(--fs-xs); margin-left: 4px; }
.mv-crumbs { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.mv-crumbs a { color: var(--muted); }
.mv-node-text { font-size: var(--fs-md); line-height: 1.45; padding: 10px 12px; border-left: 4px solid var(--c, var(--accent)); background: var(--card); border-radius: var(--r-sm); }
.mv-node-text img { display: none; }
.mv-node-sub { font-weight: 400; color: var(--muted); font-size: var(--fs); margin-top: 4px; line-height: 1.5; }
.mv-times { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.mv-time { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mv-fig { margin: 10px 0 0; }
.mv-fig img { width: 100%; border-radius: var(--r); box-shadow: var(--sh-md); display: block; cursor: zoom-in; }
.mv-fig figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; line-height: 1.45; }
.mv-credit { margin-top: 4px; }
.mv-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mv-empty { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
/* dettaglio fissato: resta aperto finche' non si sceglie un altro nodo o si preme Esc */
.mv-pinned { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mv-pin { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 2px 8px; border-radius: 999px; }
.mv-x { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.mv-x:hover { background: var(--accent-bg); }
.mv-sheet-handle { display: none; }

.mv-copy { float: right; margin-left: 8px; }
.mv-flags { margin: 8px 0; }
.mv-flag { display: inline-block; font-size: var(--fs-xs); padding: 2px 8px; border-radius: 6px; background: var(--accent-bg); margin: 0 4px 4px 0; }
.mv-flag.warn { background: var(--mark); }
.mv-note { display: flex; gap: 6px; margin: 8px 0; padding: 8px 10px; background: var(--accent-bg); border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: 1.5; }
.mv-note-ic { margin-right: 6px; }

/* icone di categoria (set nostro, icons.svg): prendono il colore via currentColor */
.ic { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.17em; flex: 0 0 auto; color: inherit; }
.nd-e { display: inline-flex; align-items: center; color: var(--c, var(--text-2)); }
.nd-e .ic { width: 17px; height: 17px; vertical-align: middle; }
.nd-ic .ic { width: 13px; height: 13px; color: var(--muted); }
.mv-emoji { display: inline-flex; width: 24px; align-items: center; color: var(--text-2); }
.mv-emoji .ic { width: 17px; height: 17px; }
.mv-node-text .ic, .mv-note .ic, .mv-tip-note .ic { width: 15px; height: 15px; color: var(--c, var(--text-2)); }
.mv-note-ic .ic { color: var(--accent); }
.mv-flag .ic { width: 13px; height: 13px; }
.bd-ge { display: inline-flex; color: var(--c, var(--text-2)); }
.bd-ge .ic, .bd-gh .ic { width: 18px; height: 18px; }
.bd-card .ic { width: 13px; height: 13px; color: var(--muted); }
.tls-t .ic, .tlv-ic .ic { width: 15px; height: 15px; color: var(--c); }
.tl-ci { color: var(--c); }
.pv-q-text .ic, .fc-q .ic, .srs-q .ic { width: 15px; height: 15px; color: var(--accent); margin-right: 4px; }
.md .ic { width: 15px; height: 15px; color: var(--text-2); }
.me-host me-tpc .ic { width: 15px; height: 15px; }

/* nodi come card */
.mv-canvas .markmap-node > line { display: none; }
.mv-canvas .markmap-node > circle { stroke-width: 2px; r: 6px; transition: r .15s; }
.mv-canvas .markmap-node > circle:hover { r: 8px; }
.mv-canvas .markmap-foreign { overflow: visible; cursor: pointer; }
.mv-canvas .markmap-foreign > div > div { position: relative; background: var(--card); color: var(--text); border-radius: var(--r); padding: 6px 10px; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--accent)); box-shadow: var(--sh-sm); transition: box-shadow .15s, transform .15s; font-family: var(--font); }
.mv-canvas g[data-depth="1"] .markmap-foreign > div > div { font-size: 18px; font-weight: 700; border: 2px solid var(--c, #64748b); padding: 10px 16px; border-radius: var(--r-md); }
.mv-canvas g[data-depth="2"] .markmap-foreign > div > div { font-size: 16px; font-weight: 600; }
.mv-canvas .markmap-foreign > div > div:hover { box-shadow: var(--sh-md); }
.mv-canvas .markmap-foreign img { width: 150px; height: 100px; object-fit: cover; border-radius: 8px; display: block; margin: 6px 0 4px; box-shadow: var(--sh-sm); }
.mv-canvas svg.noimg .markmap-foreign img { display: none; }
.mv-canvas .markmap-foreign strong { font-weight: 600; }
.mv-canvas .markmap-foreign em { color: var(--muted); }
.mv-canvas .markmap-node.sel .markmap-foreign > div > div { box-shadow: 0 0 0 3px var(--c, var(--accent)), var(--sh-md); background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--card)); }
.mv-canvas .markmap-node.hit .markmap-foreign > div > div { box-shadow: 0 0 0 3px var(--warn), var(--sh-md); }
.mv-canvas .markmap-link { stroke-width: 2.5px; transition: opacity .2s; }
.mv-canvas .markmap-node { transition: opacity .2s; }
.mv-canvas svg.hovering .markmap-node:not(.lit), .mv-canvas svg.hovering .markmap-link:not(.lit) { opacity: .3; }
.mv-canvas .markmap-node.hit2 .markmap-foreign > div > div { outline: 2px dashed var(--warn); outline-offset: 2px; }
.mv-canvas .markmap-node.has-note .markmap-foreign > div > div::after { content: "ℹ"; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); font-style: normal; }
.mv-canvas .markmap-foreign > div > div.selectable { user-select: text; -webkit-user-select: text; cursor: text; box-shadow: 0 0 0 3px var(--warn), var(--sh-md); }
.nd { display: flex; flex-direction: column; gap: 2px; }
.nd-t { display: flex; align-items: baseline; gap: 6px; }
.nd-e { font-size: 15px; line-height: 1; }
.nd-title { font-weight: 600; }
.nd-ic { display: inline-flex; gap: 3px; margin-left: auto; padding-left: 6px; font-size: 11px; opacity: .8; align-self: center; white-space: nowrap; }
.nd-ic i { font-style: normal; line-height: 1; }
.nd-ic i.nd-ts { cursor: pointer; }
.nd-ic i.nd-ts:hover { opacity: 1; transform: scale(1.25); }
.nd-s { font-size: 13px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 400; }
.nd-title.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.nd .nd-t { flex-wrap: nowrap; }
.mv-canvas g[data-depth="1"] .nd-s { font-size: 14px; }
/* tooltip, menu contestuale, tour */
.mv-notetip { position: absolute; z-index: 25; max-width: 320px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r); padding: 8px 11px; font-size: var(--fs-sm); line-height: 1.45; box-shadow: var(--sh-lg); pointer-events: none; display: block; max-height: 190px; overflow: hidden; }
.mv-tip-note { margin-top: 4px; padding: 6px 8px; background: var(--accent-bg); border-radius: 6px; }
.mv-ctx { position: fixed; z-index: 120; min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; gap: 2px; user-select: none; animation: popin var(--dur) var(--ease); }
.mv-ctx button { border: none; background: none; text-align: left; padding: 7px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); display: flex; gap: 8px; align-items: center; font-weight: 500; }
.mv-ctx button:hover { background: var(--accent-bg); color: var(--accent-fg); }
.mv-ctx .mv-ctx-title { font-size: 11.5px; color: var(--muted); padding: 4px 10px 2px; text-transform: uppercase; letter-spacing: .06em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 300px; font-weight: 700; }
.mv-ctx-meta { font-size: var(--fs-xs); color: var(--muted); padding: 0 10px 6px; }
.mv-ctx hr { border: none; border-top: 1px solid var(--line); margin: 3px 0; }
.mv-tour { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-lg); max-width: calc(100% - 24px); }
.mv-tour-title { display: flex; flex-direction: column; min-width: 160px; max-width: 360px; text-align: center; line-height: 1.25; }
.mv-tour-title b { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-tour button { padding: 6px 10px; font-size: var(--fs-sm); border-radius: 9px; }
.mv.touring .mv-hint { display: none; }
#mv-tour.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* schermo intero */
.mv:fullscreen { background: var(--bg); --mv-h: calc(100vh - 44px); }
.mv:fullscreen .mv-body { height: auto; }
.mv:fullscreen .mv-bar { min-height: 42px; padding: 4px 10px; }
.mv:fullscreen .mv-ic { height: 30px; min-width: 30px; padding: 3px 7px; }
.mv:fullscreen .mv-search input { padding: 5px 30px 5px 28px; }
.tl:fullscreen, .tl-simple-host:fullscreen { background: var(--bg); overflow: auto; }
.tl:fullscreen .tl-bar { position: sticky; top: 0; z-index: 30; }
/* niente selezione accidentale */
.mv-canvas svg.markmap, .mv-canvas .markmap-foreign, .mv-canvas .markmap-foreign > div > div, .mv-bar, .mv-seg, .tabs, .tl-svg, .srs-prog, .srs-actions, .srs-help, .fc-toggle, .fc-sec, .fc-bar, .pv-head, .bd-host { user-select: none; -webkit-user-select: none; }
.mv-panel, .mv-node-text { user-select: text; -webkit-user-select: text; }

/* vista Mappa mentale (Mind Elixir) */
.mv-left { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
.me-host { display: none; position: absolute !important; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
.mv-canvas.mind .me-host { display: block; }
.me-host > .map-container { width: 100% !important; height: 100% !important; }
.mv-canvas.mind svg.markmap, .mv-canvas.board svg.markmap { visibility: hidden; }
.me-host .map-container { background: transparent !important; }
.me-host me-tpc { font: 400 13.5px/1.35 var(--font); color: var(--text); }
.me-host me-tpc .nd-s { color: inherit; opacity: .75; }
.me-host me-tpc img { border-radius: 8px; }
/* radice: card grande e pulita (numero lezione + titolo), senza data */
.me-host me-root me-tpc { background: linear-gradient(135deg, var(--accent), #7c3aed) !important; color: #fff !important; border: none !important; border-radius: 18px !important; padding: 14px 24px !important; font-size: 16px !important; box-shadow: 0 10px 30px rgba(79, 70, 229, .35); max-width: 360px; }
.me-host .me-rootcard { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.me-host .me-rk { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; font-weight: 700; }
.me-host .me-rt { font-size: 16px; font-weight: 700; line-height: 1.3; white-space: normal; }
/* rami di primo livello: card colorate con il colore del ramo (Mind Elixir lo passa come border-color) */
.me-host me-main > me-wrapper > me-parent > me-tpc { background: var(--card) !important; border-width: 2px !important; border-left-width: 6px !important; border-radius: 12px !important; padding: 9px 14px !important; font-size: 14.5px !important; font-weight: 600; box-shadow: var(--sh-sm); max-width: 300px; }
.me-host me-main > me-wrapper > me-parent > me-tpc .nd-title { font-weight: 600; white-space: normal; }
/* nodi successivi: card leggere */
.me-host me-children me-parent > me-tpc { background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: 10px !important; padding: 6px 11px !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); max-width: 320px; }
.me-host me-children me-parent > me-tpc .nd-title { white-space: normal; }
.me-host me-epd { background: var(--card); border: 1.5px solid var(--text-2); }
/* selezione: la regola dello sfondo chiaro vale solo per i nodi dei rami; il nodo centrale tiene il suo sfondo colorato
   con il testo bianco (prima, selezionato, diventava chiaro con scritta bianca: illeggibile) */
.me-host me-main me-tpc.selected, .me-host me-main me-tpc:focus { box-shadow: 0 0 0 3px var(--c, var(--accent)) !important; background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--card)) !important; }
.me-host me-root me-tpc.selected, .me-host me-root me-tpc:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent), 0 10px 30px -10px rgba(0,0,0,.35) !important; color: #fff !important; }

/* ============================ LAVAGNA (board) ============================ */
.bd-host { display: none; position: absolute; inset: 0; overflow: hidden; cursor: grab; }
.bd-host:active { cursor: grabbing; }
.mv-canvas.board .bd-host { display: block; }
.bd-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
/* frecce dei collegamenti SOTTO le card; etichetta solo al passaggio del mouse sulla card collegata */
.bd-links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.bd-group, .bd-root, .bd-sec { z-index: 1; }
.bd-links path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 6; opacity: .45; transition: opacity .15s, stroke-width .15s; }
.bd-links text { fill: var(--text); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.bd-link.on path { opacity: 1; stroke-width: 3; stroke-dasharray: none; }
.bd-link.on text { opacity: 1; }
.bd-host.hovering .bd-link.on { z-index: 3; }
.bd-card.linked::after { content: "⇄"; position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: var(--accent); opacity: .8; }
.bd-sec { position: absolute; padding: 8px 14px; border-radius: 10px; background: var(--card); border-left: 6px solid var(--c, var(--accent)); color: var(--text); font-weight: 700; font-size: 16px; box-shadow: var(--sh-sm); }
.bd-group { position: absolute; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); box-shadow: var(--sh-sm); }
.bd-group.sketch { background: transparent; border-color: transparent; box-shadow: none; }
.bd-gh { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text); padding: 2px 4px 4px; }
.bd-gh .bd-ge { font-size: 18px; }
.bd-gh .bd-gn { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.bd-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--accent)); border-radius: 10px; padding: 8px 10px; box-shadow: var(--sh-sm); cursor: pointer; transition: box-shadow .15s, transform .15s; position: relative; }
.bd-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.bd-card.sel { box-shadow: 0 0 0 3px var(--c, var(--accent)), var(--sh-md); background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--card)); }
.bd-card .nd-title { font-weight: 600; font-size: 14px; }
.bd-card .nd-s { -webkit-line-clamp: 3; }
.bd-card img { width: 100%; height: 118px; object-fit: cover; border-radius: 8px; margin: 6px 0 2px; display: block; background: var(--bg); }
.bd-card ul { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.bd-card ul li { margin: 2px 0; }
.bd-card .bd-note { position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bd-root { position: absolute; padding: 12px 20px; border-radius: 14px; background: linear-gradient(135deg, #1e293b, #475569); color: #fff; font-weight: 700; font-size: 18px; line-height: 1.3; box-shadow: var(--sh-md); white-space: normal; }
:root[data-theme="dark"] .bd-root, :root:not([data-theme="light"]).sys-dark .bd-root { background: linear-gradient(135deg, #312e81, #4f46e5); }
.bd-mini { position: absolute; right: 12px; bottom: 12px; width: 170px; height: 110px; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-md); overflow: hidden; pointer-events: none; }
.bd-mini i { position: absolute; border-radius: 3px; background: var(--c, var(--accent)); opacity: .55; }
.bd-mini .bd-vp { position: absolute; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 3px; }
.bd-sketch-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.bd-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.bd-host.hovering .bd-card:not(.lit), .bd-host.hovering .bd-group:not(.lit) { opacity: .45; }
.bd-card, .bd-group { transition: opacity .2s; }

/* ============================ CRONOLOGIA: vista SEMPLICE (lettura) ============================ */
.tl-simple-host { padding: 14px 16px 24px; overflow: auto; }
main.ws .tl-simple-host { height: 100%; }
.tls { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.tls-era { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.tls-era:first-child { margin-top: 4px; }
.tls-era span { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.tls-era small { font-size: var(--fs-xs); color: var(--muted); }
.tls-item { display: grid; grid-template-columns: 124px 1fr; gap: 14px; align-items: start; padding: 10px 12px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.tls-item:hover { background: var(--card); }
.tls-item.open { background: var(--card); box-shadow: var(--sh-sm); }
.tls-item.extra .tls-year, .tls-item.extra .tls-t { opacity: .85; }
.tls-year { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--c); line-height: 1.25; letter-spacing: -.01em; text-align: right; padding-top: 1px; }
.tls-body { min-width: 0; }
.tls-t { display: flex; align-items: baseline; gap: 9px; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.tls-ic { flex: 0 0 auto; display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); position: relative; top: -2px; }
.tls-ic .ic { width: 16px; height: 16px; }
.tls-d { margin-top: 3px; font-size: 13.5px; color: var(--muted); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tls-item.open .tls-d { white-space: normal; color: var(--text-2); }
.tls-meta { display: none; margin-top: 8px; flex-wrap: wrap; gap: 6px 12px; font-size: var(--fs-xs); color: var(--muted); align-items: center; }
.tls-item.open .tls-meta { display: flex; }
.tls-foot { max-width: 780px; margin: 18px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 12px; }
.tls-foot .tls-adv { font-size: var(--fs-xs); color: var(--muted); }
.tls-foot.compact { margin-top: 6px; font-size: var(--fs-xs); justify-content: flex-end; }
.tls.compact { gap: 2px; }
.tls.compact .tls-item { grid-template-columns: 96px 1fr; padding: 5px 8px; border-radius: 8px; }
.tls.compact .tls-year { font-size: 13.5px; }
.tls.compact .tls-t { font-size: 13.5px; }
.tls.compact .tls-d { font-size: 12px; }
.tls-back { white-space: nowrap; }
@media (max-width: 640px) {
  .tls-item { grid-template-columns: 1fr; gap: 2px; padding: 10px 8px; }
  .tls-year { text-align: left; font-size: 15px; }
  .tls-d { white-space: normal; }
}

/* ============================ CRONOLOGIA (timeline) ============================ */
.tl { position: relative; display: flex; flex-direction: column; min-height: 0; }
.ws .tl, main.ws .tl { height: 100%; }
.tl-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex: 0 0 auto; }
main.ws .tl-bar { padding: 8px 12px; margin: 0; border-bottom: 1px solid var(--line); background: var(--card); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); padding: 4px 10px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--card); color: var(--text); text-transform: capitalize; }
.tl-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.tl-chip.off { opacity: .4; text-decoration: line-through; }
.tl-chip.static { cursor: default; padding: 2px 8px; }
.tl-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.3px); background-size: 22px 22px; }
main.ws .tl-wrap { border: none; border-radius: 0; flex: 1 1 auto; min-height: 220px; overflow: auto; }
main.ws .tl-tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; background: var(--card); }
main.ws .tl-detail { margin: 8px 12px; }
.tl-svg { display: block; width: 100%; cursor: grab; font: 12px var(--font); }
.tl-svg:active { cursor: grabbing; }
.tl-lane { fill: transparent; }
.tl-lane.alt { fill: color-mix(in srgb, var(--card) 55%, transparent); }
.tl-lane-label { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.tl-axis text { fill: var(--muted); font-size: 11.5px; }
.tl-axis path, .tl-axis line { stroke: var(--line); }
.tl-axis .tl-grid { stroke: var(--line); stroke-dasharray: 2 4; opacity: .7; }
.tl-ev { cursor: pointer; }
.tl-ev .tl-range { fill: var(--c); opacity: .85; stroke: var(--card); stroke-width: 1.5; }
.tl-ev .tl-dot { fill: var(--c); stroke: var(--card); stroke-width: 2; }
.tl-ev .tl-text { fill: var(--text); font-size: 12px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.tl-ev .tl-text.inside { fill: #fff; stroke: none; font-weight: 600; }
.tl-ev:hover .tl-range, .tl-ev.sel .tl-range { opacity: 1; stroke: var(--text); }
.tl-ev:hover .tl-dot, .tl-ev.sel .tl-dot { r: 8; stroke: var(--text); }
.tl-tip { position: absolute; z-index: 40; max-width: 300px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font-size: var(--fs-sm); line-height: 1.4; box-shadow: var(--sh-lg); pointer-events: none; }
.tl-tip-y { color: var(--muted); font-size: var(--fs-xs); margin: 2px 0 4px; }
.tl-detail { margin-top: 10px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r); padding: 10px 14px; background: var(--card); }
.tl-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-detail-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tl-detail-body { margin-top: 6px; line-height: 1.5; }
.tl-tablewrap { margin-top: 12px; overflow: auto; }
.tl-table th.sortable { cursor: pointer; user-select: none; }
.tl-table th.sortable:hover { color: var(--accent); }
.tl-table tr.sel td { background: var(--hl); }
.tl-table tr[data-id] { cursor: pointer; }
.tl-table .nowrap { white-space: nowrap; }
.tl-table .ts { color: var(--accent); cursor: pointer; }
#pv-tl .tl-wrap { border-radius: var(--r); }
#pv-tl .tl-svg { font-size: 11px; }
/* nuova timeline: asse centrale, card, fasce, brush, verticale */
.tl-filters { display: flex; flex-direction: column; gap: 6px; width: 100%; }
/* gruppi di filtri: etichetta, chip a scorrimento orizzontale, tutti/nessuno */
.tl-fg { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-fg-l { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; flex: 0 0 74px; }
.tl-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 2px 0; }
.tl-chips::-webkit-scrollbar { display: none; }
.tl-fg-a { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.tl-fg-a button { border: none; background: none; color: var(--muted); font-size: var(--fs-xs); padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.tl-fg-a button:hover { background: var(--accent-bg); color: var(--accent-fg); }
.tl-fg-text input { flex: 0 1 260px; padding: 5px 9px; font-size: var(--fs-sm); border-radius: var(--r); }
.tl-fg-years input { width: 110px; padding: 5px 8px; font-size: var(--fs-sm); border-radius: var(--r); }
.tl-fg-act { gap: 10px; flex-wrap: wrap; }
.tl-tools.tl-row { padding-top: 0; border-top: none; margin-top: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; }
.tl-tools.tl-row::-webkit-scrollbar { display: none; }
.tl-tools.tl-row > * { flex: 0 0 auto; }
/* punti senza etichetta (si aprono con un clic) e chiusura della card */
.tl-ev.point.nolabel .tl-dot { stroke: var(--card); stroke-width: 2.5; fill: var(--c); filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .25)); cursor: pointer; }
.tl-ev.point.nolabel:hover .tl-dot { r: 9; }
.tl-ev.point.nolabel.main .tl-dot { stroke: var(--text); }
.tl-x { cursor: pointer; opacity: 0; transition: opacity .15s; }
.tl-ev:hover .tl-x, .tl-ev.sel .tl-x { opacity: 1; }
.tl-x circle { fill: var(--card); stroke: var(--text-2); stroke-width: 1.2; }
.tl-x text { fill: var(--text); font-size: 12px; font-weight: 700; }
@media (max-width: 700px) { .tl-fg-l { flex-basis: 56px; } .tl-fg-years input { width: 86px; } .tl-fg-text input { flex-basis: 160px; } }
.tl-chip.src { background: var(--card-3); border-color: transparent; color: var(--text-2); text-transform: none; }
.tl-chip.src.off { opacity: .4; }
.tl-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); margin: 0; white-space: nowrap; cursor: pointer; }
.tl-toggle input { margin: 0; }
.tl-note { font-size: var(--fs-xs); color: var(--muted); padding: 4px 12px; }
.tl-axisline { stroke: var(--text-2); stroke-width: 2; }
.tl-axis2 .tk line { stroke: var(--text-2); stroke-width: 1.2; }
.tl-axis2 .tk.minor line { stroke: var(--line-2); }
.tl-axis2 .tk text { fill: var(--text-2); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.tl-axis2 .tk:not(.major) text { font-weight: 400; fill: var(--muted); font-size: 10.5px; }
.tl-axis2 .tk line.tl-grid { stroke: var(--line); stroke-dasharray: 3 5; opacity: .9; }
.tl-band rect { opacity: .10; }
.tl-band text { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.tl-ev.range rect.tl-range { fill: var(--c); opacity: .9; stroke: var(--card); stroke-width: 1.2; }
.tl-ev.range.approx rect.tl-range { opacity: .55; stroke: var(--c); stroke-dasharray: 5 4; stroke-width: 1.5; }
.tl-ev.range text.tl-rlabel { fill: var(--text); font-size: 11px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.bd-card .bd-more { color: var(--accent); list-style: none; margin-left: -16px; font-size: 12px; }
.tl-ev.range text.tl-rlabel.inside { fill: #fff; stroke: none; font-weight: 600; }
.tl-ev.range.approx text.tl-rlabel.inside { fill: var(--text); }
.tl-ev.point .tl-conn { stroke: var(--c); stroke-width: 1.4; opacity: .7; }
.tl-ev.point .tl-dot { fill: var(--c); stroke: var(--card); stroke-width: 2; }
.tl-ev.point .tl-card rect { fill: var(--card); stroke: var(--c); stroke-width: 1.4; filter: drop-shadow(0 2px 4px rgba(15, 23, 42, .12)); }
.tl-ev.point.approx .tl-card rect { stroke-dasharray: 5 4; fill: color-mix(in srgb, var(--card) 85%, var(--bg)); }
.tl-ev.point .tl-card .tl-ct { fill: var(--text); font-size: 12px; font-weight: 600; }
.tl-ev.point .tl-card .tl-cy { fill: var(--muted); font-size: 10.5px; }
.tl-ev.point .tl-card .tl-ci { font-size: 13px; }
.tl-ev:hover .tl-card rect, .tl-ev.sel .tl-card rect { stroke-width: 2.4; filter: drop-shadow(0 6px 12px rgba(15, 23, 42, .22)); }
.tl-ev:hover .tl-dot, .tl-ev.sel .tl-dot { r: 8; }
.tl-ev:hover rect.tl-range, .tl-ev.sel rect.tl-range { opacity: 1; stroke: var(--text); }
.tl-brushwrap { margin-top: 6px; }
main.ws .tl-brushwrap { padding: 0 12px 6px; background: var(--card); border-top: 1px solid var(--line); }
.tl-bsvg { display: block; width: 100%; height: 36px; }
.tl-bsvg .tl-bax text { fill: var(--muted); font-size: 10px; }
.tl-bsvg .tl-bax path, .tl-bsvg .tl-bax line { stroke: var(--line-2); }
.tl-bsvg .selection { fill: var(--accent); fill-opacity: .15; stroke: var(--accent); stroke-width: 1.2; }
.tl-bsvg .handle { fill: var(--accent); }
.tlv { position: relative; padding: 10px 0 20px; max-width: 980px; margin: 0 auto; }
.tlv::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--line-2); transform: translateX(-50%); border-radius: 2px; }
.tlv-century { position: relative; text-align: center; margin: 18px 0 10px; z-index: 1; }
.tlv-century span { display: inline-block; background: var(--text); color: var(--card); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border-radius: var(--r-full); }
.tlv-item { position: relative; width: 50%; padding: 6px 36px 10px 0; cursor: pointer; }
.tlv-item.right { margin-left: 50%; padding: 6px 0 10px 36px; }
.tlv-item::before { content: ""; position: absolute; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--c); right: -8.5px; }
.tlv-item.right::before { right: auto; left: -8.5px; }
.tlv-item.approx::before { background: var(--card); }
.tlv-year { font-family: var(--mono); font-size: var(--fs-xs); color: var(--c); font-weight: 700; margin-bottom: 4px; text-align: right; }
.tlv-item.right .tlv-year { text-align: left; }
.tlv-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--sh-sm); transition: box-shadow .15s, transform .15s; }
.tlv-item.right .tlv-card { border-left: 1px solid var(--line); border-right: 4px solid var(--c); }
.tlv-item.approx .tlv-card { border-style: dashed; }
.tlv-item:hover .tlv-card, .tlv-item.sel .tlv-card { box-shadow: var(--sh-md); transform: translateY(-1px); }
.tlv-t { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-md); }
.tlv-d { font-size: var(--fs-sm); color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.tlv-m { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tlv-m .ts { cursor: pointer; color: var(--accent); }
@media (max-width: 700px) { .tlv::before { left: 14px; } .tlv-item, .tlv-item.right { width: 100%; margin-left: 0; padding: 6px 0 10px 36px; } .tlv-item::before, .tlv-item.right::before { left: 6.5px; right: auto; } .tlv-year, .tlv-item.right .tlv-year { text-align: left; } .tlv-item .tlv-card { border-left: 4px solid var(--c); border-right: 1px solid var(--line); } }

/* Temi: striscia di numeri (una riga sola, anche su mobile) + pannello verticale con i titoli interi */
.mv-temi { display: flex; align-items: center; gap: 8px; position: relative; flex: 0 1 auto; min-width: 0; }
.mv-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.mv-temi-strip { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; max-width: 46vw; padding: 2px; }
.mv-temi-strip::-webkit-scrollbar { display: none; }
.mv-tn { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--c, var(--accent)); background: var(--card); color: var(--c, var(--accent)); font: 700 11.5px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: transform .12s, background .12s; }
.mv-tn:hover { transform: scale(1.12); }
.mv-tn.on { background: var(--c, var(--accent)); color: #fff; }
.mv-temi-panel { position: absolute; left: 0; top: 40px; z-index: 75; width: min(400px, calc(100vw - 16px)); overflow-x: hidden; max-height: min(70vh, 640px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: 8px; animation: popin var(--dur) var(--ease); }
.mv-tp-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 8px; font-size: var(--fs-sm); }
.mv-tg-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 10px 4px; display: flex; gap: 6px; align-items: center; }
.mv-tg-h .ic { width: 14px; height: 14px; }
.mv-ti { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font: 500 var(--fs-sm)/1.35 var(--font); cursor: pointer; }
.mv-ti:hover { background: var(--accent-bg); }
.mv-ti.on { background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); }
.mv-ti .mv-tn { width: 22px; height: 22px; font-size: 11px; }
.mv-ti.all .mv-ti-t { font-weight: 700; }
.mv-ti-ic { display: inline-flex; color: var(--c, var(--text-2)); width: 18px; }
.mv-ti-ic .ic { width: 16px; height: 16px; }
.mv-ti-t { flex: 1; min-width: 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mv-ti-n { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; flex: 0 0 auto; min-width: 70px; text-align: right; padding-top: 2px; }
.mv-canvas svg.focusing .markmap-node.dim, .mv-canvas svg.focusing .markmap-link.dim { opacity: .22; }
.bd-host.focus .bd-group:not(.lit) { opacity: .3; }
@media (max-width: 700px) { .mv-temi-strip { max-width: 56vw; } .mv-temi-btn-label { display: none; } }

/* modalita' statica (pagina condivisa): niente audio, timestamp come testo, nessun selettore interno di vista */
.mv.static .nd-ts, .mv.static .mv-view, .mv.static #mv-tour { display: none !important; }
.mv.static .mv-hint b { display: none; }


@media (max-width: 600px) {
  .mv-search { flex: 0 1 150px; min-width: 110px; }
  .mv-hint { display: none; }
}

/* ---- ricerca: tendina dei suggerimenti (position fixed, fuori dalla barra) e barra dei risultati sulla tela */
.mv-sugg { position: fixed; z-index: 95; width: 420px; max-height: 60vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; animation: popin var(--dur) var(--ease); }
.mv-sg { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); cursor: pointer; font: 500 var(--fs-sm)/1.35 var(--font); }
.mv-sg:hover, .mv-sg.active { background: var(--accent-bg); }
.mv-sg-t { font-weight: 600; min-width: 0; }
.mv-sg-b { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; align-self: center; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mv-sg-c { grid-column: 1 / -1; color: var(--text-2); font-size: var(--fs-xs); line-height: 1.4; }
.mv-sg mark, .mv-sg-c mark { background: var(--mark, #fde68a); color: inherit; border-radius: 3px; padding: 0 1px; }
.mv-sg-more { padding: 6px 10px; font-size: var(--fs-xs); color: var(--muted); }
.mv-qbar { position: absolute; left: 12px; top: 12px; z-index: 22; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--sh-md); backdrop-filter: blur(8px); font-size: var(--fs-sm); }
.mv-qbar.hidden { display: none; }
.mv-qbar #mv-qcount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-qbar .mv-ic { height: 28px; min-width: 28px; padding: 2px 6px; }
.mv-qonly { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; cursor: pointer; }
.mv-qonly input { margin: 0; }
@media (max-width: 700px) { .mv-qbar { left: 8px; right: 8px; top: 8px; flex-wrap: wrap; border-radius: 14px; } .mv-sugg { width: calc(100vw - 16px) !important; left: 8px !important; } }

/* ---- Mentale: ramo in evidenza / rami attenuati; risultati della ricerca */
.me-host me-wrapper { transition: opacity .2s; }
.me-host me-wrapper.dim { opacity: .22; }
.me-host me-tpc.hit { box-shadow: 0 0 0 3px var(--warn) !important; }
.me-host me-tpc.hit2 { outline: 2px dashed var(--warn); outline-offset: 2px; }

/* ---- Lavagna: testo intero (niente puntini), sottopunti tutti visibili (oltre 6: "mostra altri"), riquadri adattivi */
.bd-card .nd-title, .bd-card .nd-title.wrap { display: inline; white-space: normal; overflow: visible; -webkit-line-clamp: unset; line-height: 1.3; }
.bd-card .nd-s { display: block; -webkit-line-clamp: unset; overflow: visible; margin-top: 2px; }
.bd-card .nd-t { flex-wrap: wrap; align-items: baseline; }
.bd-card ul li { margin: 3px 0; line-height: 1.4; }
.bd-card li.bd-extra { display: none; }
.bd-card .bd-more { cursor: pointer; font-weight: 600; }
.bd-card .bd-more:hover { text-decoration: underline; }
.bd-group.hidden { display: none; }
.bd-card.hit { box-shadow: 0 0 0 3px var(--warn), var(--sh-md); }
.bd-card.hit2 { outline: 2px dashed var(--warn); outline-offset: 1px; }
.bd-card.qdim { opacity: .3; }

/* ---- schermo intero in modalita' CSS (fullscreen.js: quando la Fullscreen API non c'e' o viene rifiutata) */
.lz-fs { position: fixed !important; inset: 0 !important; z-index: 500 !important; width: auto !important; height: auto !important; max-height: none !important; margin: 0 !important; border-radius: 0 !important; background: var(--bg); overflow: auto; }
html.lz-fs-on { overflow: hidden; }
.mv.lz-fs { --mv-h: calc(100vh - 44px); display: flex; flex-direction: column; }
.mv.lz-fs .mv-body { height: auto; flex: 1; min-height: 0; }
.mv.lz-fs .mv-bar { min-height: 42px; padding: 4px 10px; }
.mv.lz-fs .mv-ic { height: 30px; min-width: 30px; padding: 3px 7px; }
.tl.lz-fs .tl-bar { position: sticky; top: 0; z-index: 30; }

/* ---- cronologia semplice: riga in alto (conteggio + schermo intero) */
.tls-top { max-width: 780px; margin: 0 auto 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; }
.tl-fs svg { display: block; }
.tl.fs-on, .tl-simple-host.fs-on { padding: 14px 16px 24px; }
.hidden { display: none !important; }

/* la sezione del nodo selezionato lampeggia quando cambia (si vede subito dove leggere) */
.mv-sec.flash { animation: secflash 1.2s ease-out; }
@keyframes secflash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .mv-sec.flash { animation: none; } }

/* ---- pannello a due schede: Lezione | Nodo */
.mv-ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex: 0 0 auto; margin-bottom: 2px; }
.mv-ptab { border: none; background: none; padding: 8px 12px; font: 600 var(--fs-sm)/1 var(--font); color: var(--muted); border-radius: var(--r-sm) var(--r-sm) 0 0; cursor: pointer; position: relative; display: inline-flex; align-items: center; gap: 6px; }
.mv-ptab:hover { color: var(--text); background: var(--accent-bg); }
.mv-ptab.active { color: var(--text); }
.mv-ptab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--c, var(--accent)); border-radius: 2px; }
.mv-ptab.has::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); display: inline-block; }
.mv-pane { display: flex; flex-direction: column; gap: 10px; }
.mv-pane.hidden { display: none; }
.mv-nodecard { border-radius: var(--r-md); overflow: hidden; border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 35%, var(--line)); background: var(--card); box-shadow: var(--sh-sm); }
.mv-nband { background: var(--c, var(--accent)); color: #fff; padding: 8px 10px 12px 14px; }
.mv-nband-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mv-nback { border: none; background: rgba(255, 255, 255, .16); color: #fff; font: 600 12.5px/1 var(--font); padding: 6px 11px 6px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: background .15s; }
.mv-nback:hover { background: rgba(255, 255, 255, .3); }
.mv-nback svg { width: 14px; height: 14px; }
.mv-nclose { width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .18); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .15s; }
.mv-nclose:hover { background: rgba(255, 255, 255, .4); }
.mv-nclose svg { width: 15px; height: 15px; }
.mv-ntitle { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.mv-ntitle .nd-e, .mv-ntitle .ic { color: #fff; }
.mv-nbranch { font-size: 12px; opacity: .9; margin-top: 3px; }
.mv-nbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.mv-nbody .mv-node-text { font-size: 14.5px; line-height: 1.5; border-left-width: 3px; }
.mv-nbody .mv-crumbs { margin-bottom: 0; }
.mv-nbody .mv-sub { margin: 4px 0 0; }
.mv-kids li a { white-space: normal; overflow-wrap: anywhere; }
/* frase della descrizione che contiene il titolo del nodo: lampeggio giallo 1,5 s */
.mv-desc mark.mv-sent { background: transparent; color: inherit; border-radius: 3px; padding: 0 2px; animation: sentflash 1.5s ease-out; }
@keyframes sentflash { 0%, 45% { background: var(--mark, #fde68a); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .mv-desc mark.mv-sent { animation: none; background: var(--mark, #fde68a); } }
@media (max-width: 700px) { .mv-temi-panel { width: calc(100vw - 16px); } }

/* ============================ DISPOSITIVI: telefono verticale (pt-phone), telefono orizzontale (pt-landscape), tablet (pt-tablet) ============================
   Le classi le mette mapview.js sul <html> con un solo listener (ritardato). Desktop: nessuna classe, layout invariato. */
.mv-canvas, .mv-canvas svg.markmap, .me-host, .bd-host { touch-action: none; overscroll-behavior: contain; }
.mv-fab { display: none; position: absolute; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; flex-direction: column; gap: 10px; align-items: flex-end; }
.mv-fabb { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--sh-md); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.mv-fabb:active { transform: scale(.96); }
.mv-fabb .lucide { width: 20px; height: 20px; }
.mv-fab-menu { position: absolute; right: 0; bottom: calc(100% + 10px); width: min(300px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 31; }
.mv-fab-menu.hidden { display: none; }
.mv-fab-menu button { display: flex; align-items: center; gap: 12px; min-height: 44px; width: 100%; border: none; background: none; padding: 6px 10px; border-radius: 10px; font: 500 14px/1.2 var(--font); color: var(--text); text-align: left; cursor: pointer; }
.mv-fab-menu button:hover { background: var(--accent-bg); }
.mv-fab-menu button .lucide { width: 19px; height: 19px; color: var(--muted); }
.mv-fab-menu .mv-search2 { flex: none; width: 100%; min-width: 0; margin-bottom: 4px; }
.mv-fab-menu .mv-search2 input { min-height: 44px; font-size: 14px; }
.mv-sheet-head, .mv-ptab-themes { display: none; }
.mv-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2, var(--line)); margin: 0 auto; }
.mv-sheet-row { display: flex; align-items: center; gap: 8px; }
.mv-sheet-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.mv-sheet-x { display: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); align-items: center; justify-content: center; padding: 0; cursor: pointer; flex: 0 0 auto; }
.mv-sheet-x svg { width: 15px; height: 15px; }
.mv-temi-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 10px; -webkit-overflow-scrolling: touch; }
.mv-temi-chips::-webkit-scrollbar { display: none; }
.mv-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 6px; border-radius: 18px; border: 1.5px solid color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--card)); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap; }
.mv-chip.all { padding: 0 14px; border-color: var(--line); background: var(--card); }
.mv-chip.on { background: var(--c, var(--accent)); color: #fff; border-color: var(--c, var(--accent)); }
.mv-chip.on .mv-tn { background: #fff; color: var(--c, var(--accent)); border-color: #fff; }
.mv-chip .mv-tn { width: 24px; height: 24px; }
.mv-temi-list .mv-ti { min-height: 44px; }

/* --- telefono verticale: una sola barra (quella della pagina), mappa a tutto schermo, foglio dal basso a tre posizioni, grappolo di pulsanti */
html.pt-phone .mv-bar, html.pt-landscape .mv-bar { display: none !important; }
html.pt-phone .mv-hint, html.pt-landscape .mv-hint, html.pt-tablet .mv-hint { display: none !important; }
html.pt-phone .mv-fab, html.pt-landscape .mv-fab { display: flex; }
html.pt-phone .mv-fab { flex-direction: row; align-items: center; gap: 8px; right: 10px; bottom: calc(56px + 8px + env(safe-area-inset-bottom)); }
html.pt-phone .mv-fabb { width: 40px; height: 40px; }
html.pt-phone .mv-fabb .lucide { width: 18px; height: 18px; }
html.pt-phone .mv[data-sheet="half"] .mv-fab, html.pt-phone .mv[data-sheet="full"] .mv-fab { display: none; }
html.pt-phone .mv-canvas.board #mv-fab-fit { display: none; }
html.pt-phone .mv .mv-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto !important; height: 56px; max-height: none !important; margin: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); box-sizing: border-box; border: none; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(15, 23, 42, .22); background: var(--card); z-index: 80; display: flex !important; flex-direction: column; gap: 6px; overflow: hidden; transform: none; transition: height .3s var(--ease); }
html.pt-phone .mv[data-sheet="half"] .mv-panel { height: 50vh; height: 50dvh; }
html.pt-phone .mv[data-sheet="full"] .mv-panel { height: 90vh; height: 90dvh; }
html.pt-phone .mv .mv-panel.dragging { transition: none; }
html.pt-phone .mv-sheet-head { display: block; flex: 0 0 auto; height: 56px; box-sizing: border-box; padding: 10px 0 0; touch-action: none; cursor: grab; }
html.pt-phone .mv-sheet-row { margin-top: 10px; }
html.pt-phone .mv-ptab-themes { display: inline-flex; }
html.pt-phone .mv .mv-panel .mv-ptabs { flex: 0 0 auto; }
html.pt-phone .mv .mv-panel .mv-ptab { min-height: 40px; }
html.pt-phone .mv .mv-panel .mv-pane { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 12px; }
html.pt-phone .mv .mv-panel .mv-sec { border: none; padding: 0; background: transparent; }
html.pt-phone .mv-nback { display: inline-flex; }
html.pt-phone .mv-canvas .markmap-foreign > div > div { font-size: 13.5px; }
html.pt-phone .mv-canvas g[data-depth="1"] .markmap-foreign > div > div { font-size: 16px; padding: 8px 12px; }
html.pt-phone .mv-canvas g[data-depth="2"] .markmap-foreign > div > div { font-size: 14px; }
html.pt-phone .mv-qbar { left: 8px; right: 8px; top: 8px; flex-wrap: wrap; border-radius: 14px; }
/* Lavagna a lista: una colonna di card che scorre normalmente, niente tela zoomabile */
html.pt-phone .bd-host.list { overflow: auto; touch-action: pan-y; cursor: default; -webkit-overflow-scrolling: touch; }
html.pt-phone .bd-host.list .bd-layer { position: relative; transform: none !important; }
html.pt-phone .bd-host.list .bd-mini, html.pt-phone .bd-host.list .bd-links, html.pt-phone .bd-host.list .bd-sketch-svg { display: none; }
html.pt-phone .bd-host.list .bd-root { font-size: 15px; padding: 10px 14px; }
html.pt-phone .bd-host.list .bd-card { padding: 10px 12px; }
html.pt-phone .bd-host.list .bd-card .nd-title { font-size: 15px; }
html.pt-phone .bd-host.list .bd-card ul { font-size: 13.5px; }

/* --- telefono in orizzontale e tablet: pannello come cassetto a destra (45% / 380 px), chiuso finche' non serve */
html.pt-landscape .mv .mv-panel, html.pt-tablet .mv .mv-panel { position: fixed; top: var(--lz-top, 0px); right: 0; bottom: 0; left: auto; width: 45vw !important; max-width: 560px; height: auto; max-height: none !important; margin: 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border: none; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(15, 23, 42, .18); background: var(--card); z-index: 80; display: flex !important; flex-direction: column; gap: 6px; overflow: hidden; transform: translateX(105%); transition: transform .3s var(--ease); }
html.pt-tablet .mv .mv-panel { width: 380px !important; }
html.pt-landscape .mv[data-sheet="half"] .mv-panel, html.pt-landscape .mv[data-sheet="full"] .mv-panel, html.pt-tablet .mv[data-sheet="half"] .mv-panel, html.pt-tablet .mv[data-sheet="full"] .mv-panel { transform: translateX(0); }
html.pt-landscape .mv-sheet-head, html.pt-tablet .mv-sheet-head { display: block; flex: 0 0 auto; }
html.pt-landscape .mv-grab, html.pt-tablet .mv-grab { display: none; }
html.pt-landscape .mv-sheet-x, html.pt-tablet .mv-sheet-x { display: inline-flex; }
html.pt-landscape .mv-sheet-title, html.pt-tablet .mv-sheet-title { text-align: left; }
html.pt-landscape .mv-ptab-themes { display: inline-flex; }
html.pt-landscape .mv .mv-panel .mv-pane, html.pt-tablet .mv .mv-panel .mv-pane { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
html.pt-landscape .mv .mv-panel .mv-sec, html.pt-tablet .mv .mv-panel .mv-sec { border: none; padding: 0; background: transparent; }
html.pt-tablet .mv-tourlbl, html.pt-tablet #mv-lv-lbl { display: none; }
html.pt-coarse.pt-tablet #mv-zout, html.pt-coarse.pt-tablet #mv-zin, html.pt-coarse.pt-tablet #mv-zpct { display: none; }
html.pt-tablet .mv-ic { min-height: 40px; min-width: 40px; }

/* ============================ CRONOLOGIA: vista semplice a zig zag ============================ */
.tlz { position: relative; max-width: 1100px; margin: 0 auto; padding: 6px 0 16px; }
.tlz::before { content: ""; position: absolute; top: 0; bottom: 0; left: 22px; width: 3px; border-radius: 2px; background: var(--line-2, var(--line)); }
.tlz.two::before { left: 50%; margin-left: -1.5px; }
.tlz-era { position: relative; z-index: 1; margin: 26px 0 14px; padding: 10px 18px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tlz-era:first-child { margin-top: 4px; }
.tlz-era-l { font-size: 18px; font-weight: 800; letter-spacing: .01em; color: var(--text); }
.tlz-era-s { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tlz-item { position: relative; width: 100%; padding: 0 0 0 52px; margin: 0 0 16px; }
.tlz.two .tlz-item { width: 50%; padding: 0 44px 0 0; }
.tlz.two .tlz-item.right { margin-left: 50%; padding: 0 0 0 44px; }
.tlz-dot { position: absolute; top: 20px; left: 15px; width: 17px; height: 17px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--c); z-index: 1; }
.tlz.two .tlz-item.left .tlz-dot { left: auto; right: -8.5px; }
.tlz.two .tlz-item.right .tlz-dot { left: -8.5px; }
.tlz-card { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 12px 16px 12px 14px; box-shadow: var(--sh-sm); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tlz-card::before { content: ""; position: absolute; top: 27px; width: 28px; height: 2px; background: var(--c); opacity: .6; left: -32px; }
.tlz.two .tlz-item.left .tlz-card { border-left: 1px solid var(--line); border-right: 4px solid var(--c); text-align: right; }
.tlz.two .tlz-item.left .tlz-card::before { left: auto; right: -32px; }
.tlz.two .tlz-item.right .tlz-card::before { left: -32px; }
.tlz-item:hover .tlz-card, .tlz-item.open .tlz-card { box-shadow: var(--sh-md); transform: translateY(-1px); }
.tlz-year { font: 700 20px/1.1 var(--mono); color: var(--c); letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.tlz-year small { display: block; font: 500 12px/1.3 var(--font); color: var(--muted); margin-top: 2px; }
.tlz-t { display: flex; align-items: baseline; gap: 9px; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.tlz.two .tlz-item.left .tlz-t { flex-direction: row-reverse; }
.tlz-d { margin-top: 4px; font-size: 13.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tlz-item.open .tlz-d { display: block; color: var(--text-2); }
.tlz-meta { display: none; margin-top: 8px; flex-wrap: wrap; gap: 6px 12px; font-size: var(--fs-xs); color: var(--muted); align-items: center; }
.tlz.two .tlz-item.left .tlz-meta { justify-content: flex-end; }
.tlz-item.open .tlz-meta { display: flex; }
.tlz-item.extra .tlz-card { border-style: dashed; }
.tlz-item.extra .tlz-year { font-size: 17px; }
.tlz-in { animation: tlzin .35s var(--ease) both; }
@keyframes tlzin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tlz-in { animation: none; } }
html.pt-phone .tlz-item { padding-left: 46px; margin-bottom: 12px; }
html.pt-phone .tlz-year { font-size: 18px; }
html.pt-phone .tlz-era { padding: 8px 14px; } html.pt-phone .tlz-era-l { font-size: 16px; }
/* ---- vista avanzata: popover dei filtri, cassetto Elenco, riga di comandi unica ---- */
.tl-fwrap { position: relative; }
.tl-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; margin-left: 2px; }
.tl-fpop { position: fixed; left: 8px; top: 60px; z-index: 60; overflow: auto; width: min(620px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: 10px 12px 12px; animation: popin var(--dur) var(--ease); }
.tl-fpop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: var(--fs-sm); }
.tl-x2 { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.tl-x2:hover { background: var(--accent-bg); }
.tl-sel { height: 34px; width: auto !important; max-width: 160px; flex: 0 0 auto; padding: 0 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 var(--fs-sm) var(--font); }
#tl-fbtn span, #tl-list span { margin-left: 5px; }
#tl-fbtn.active, #tl-list.active { color: var(--accent-fg); background: var(--accent-bg); }
.tl-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 50; background: var(--card); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(15, 23, 42, .18); display: flex; flex-direction: column; animation: drawin .25s var(--ease); }
.tl-drawer.hidden { display: none; }
@keyframes drawin { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.tl-drawer-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.tl-drawer-head .tl-x2 { margin-left: auto; }
.tl-drawer .tl-tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: none; }
.tl-el { display: flex; flex-direction: column; }
.tl-el-i { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tl-el-i:hover, .tl-el-i.sel { background: color-mix(in srgb, var(--c) 8%, var(--card)); }
.tl-el-y { font: 700 15px/1.2 var(--mono); color: var(--c); font-variant-numeric: tabular-nums; }
.tl-el-y small { display: block; font: 500 11.5px/1.3 var(--font); color: var(--muted); }
.tl-el-b { min-width: 0; font-size: 14px; line-height: 1.35; }
.tl-el-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-axis2 .tk text.tl-digits { font-size: 10px; font-weight: 400; fill: var(--muted); }
.tl-ev.point .tl-card .tl-cd { fill: var(--muted); font-size: 10px; }
html.pt-phone .tl-fpop { position: fixed; left: 8px; right: 8px; top: calc(56px + env(safe-area-inset-top)); width: auto; max-height: 70vh; overflow: auto; }

/* ---- domande della docente in aula: carte espandibili (scheda Ripasso dell'app, scheda Lezione del pannello) ---- */
.dq-sec { margin: 22px auto 0; max-width: 980px; padding: 0 12px 16px; }
.mv-panel .dq-sec { margin: 0; max-width: none; padding: 12px; }
.dq-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 4px; }
.dq-h .lucide { width: 18px; height: 18px; color: var(--accent); }
.dq-n { font-size: 12px; font-weight: 700; color: var(--accent-fg); background: var(--accent-bg); border-radius: 999px; padding: 1px 8px; }
.dq-help { margin: 0 0 10px; }
.dq-lesson { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.dq { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin: 6px 0; }
.dq summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; gap: 10px; align-items: baseline; font-weight: 600; font-size: 14px; line-height: 1.4; min-height: 40px; box-sizing: border-box; }
.dq summary::-webkit-details-marker { display: none; }
.dq summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: 0 0 auto; position: relative; top: -2px; transition: transform .2s; }
.dq[open] summary::before { transform: rotate(45deg); top: -4px; }
.dq-q { flex: 1; min-width: 0; }
.dq-q::before { content: "“"; color: var(--muted); } .dq-q::after { content: "”"; color: var(--muted); }
.dq-tag { font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.dq-body { padding: 0 12px 12px 30px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.dq-esito { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-fg); background: var(--accent-bg); border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; }
.dq .ts { color: var(--accent); cursor: pointer; font-family: var(--mono); font-size: 12.5px; margin-left: 4px; }
.dq .ts:hover { text-decoration: underline; }

/* ---- pannello Lezione: chip dei punti chiave, parole chiave evidenziate, virgolette della docente ---- */
.mv-kchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; align-items: center; }
.mv-kchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px; border-radius: 15px; border: 1.5px solid color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--card)); color: var(--text); font: 600 12.5px/1 var(--font); cursor: pointer; white-space: nowrap; }
.mv-kchip:hover { background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--card)); }
.mv-kchip .ic { width: 14px; height: 14px; color: var(--c, var(--text-2)); }
.mv-desc mark.kw { background: #fef3c7; color: #1f2937; border-radius: 3px; padding: 0 2px; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .15s; }
.mv-desc mark.kw:hover { background: #fde68a; }
:root[data-theme="dark"] .mv-desc mark.kw, :root:not([data-theme="light"]).sys-dark .mv-desc mark.kw { background: rgba(217, 119, 6, .35); color: #fde68a; }
:root[data-theme="dark"] .mv-desc mark.kw:hover, :root:not([data-theme="light"]).sys-dark .mv-desc mark.kw:hover { background: rgba(217, 119, 6, .5); }
.mv-desc i.mv-quote { font-style: italic; color: color-mix(in srgb, var(--accent) 80%, var(--text)); }
.mv-empty { display: flex; align-items: center; gap: 10px; }
.mv-empty-ic { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent-bg); color: var(--accent-fg); cursor: help; }
.mv-empty-ic .lucide { width: 18px; height: 18px; }
/* ---- scheda compatta del nodo dentro la mappa ---- */
.mv-mapcard { position: absolute; z-index: 26; width: 340px; max-width: calc(100% - 16px); max-height: 60%; overflow: auto; background: var(--card); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 40%, var(--line)); border-left: 4px solid var(--c, var(--accent)); border-radius: 12px; box-shadow: var(--sh-lg); padding: 10px 12px 12px; font-size: 13px; line-height: 1.45; animation: popin .25s var(--ease); user-select: text; -webkit-user-select: text; cursor: auto; }
.mv-mc-head { display: flex; align-items: flex-start; gap: 8px; }
.mv-mc-title { flex: 1; font-weight: 700; font-size: 14px; line-height: 1.3; }
.mv-mc-title .ic { width: 15px; height: 15px; color: var(--c); }
.mv-mc-x { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; flex: 0 0 auto; }
.mv-mc-x:hover { background: var(--accent-bg); color: var(--text); }
.mv-mc-x svg { width: 14px; height: 14px; }
.mv-mc-body { margin-top: 6px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.mv-mc-note { margin-top: 6px; padding: 6px 8px; background: var(--accent-bg); border-radius: 8px; font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mv-mc-img { display: block; width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.mv-mc-kids { margin: 8px 0 0; padding-left: 16px; font-size: 12.5px; }
.mv-mc-kids li { margin: 2px 0; }
.mv-canvas.nodecard-open svg.markmap .markmap-node:not(.sel) .markmap-foreign > div > div { opacity: .72; }
.mv-canvas.nodecard-open .me-host me-tpc:not(.selected) { opacity: .75; }
.mv-canvas.nodecard-open .bd-card:not(.sel) { opacity: .75; }
html.pt-phone .mv-mapcard { display: none !important; }
@media (prefers-reduced-motion: reduce) { .mv-mapcard { animation: none; } }
/* le carte delle domande non ereditano lo stile maiuscolo dei riquadri richiudibili del pannello */
.mv-sec .dq summary, .dq summary { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); flex-wrap: wrap; }
.dq-tag { white-space: normal; }

/* ---- telefono: etichette che vanno a capo entro larghezze massime (radice 2-3 righe), cosi' radice e temi stanno nella larghezza ---- */
html.pt-phone .mv-canvas .markmap-foreign > div > div { max-width: 176px; box-sizing: border-box; }
html.pt-phone .mv-canvas g[data-depth="1"] .markmap-foreign > div > div { max-width: 170px; font-size: 15px; padding: 8px 10px; }
html.pt-phone .mv-canvas .markmap-foreign .nd-title, html.pt-phone .mv-canvas .markmap-foreign .nd-title.wrap { white-space: normal; display: block; overflow: visible; text-overflow: clip; -webkit-line-clamp: unset; overflow-wrap: anywhere; line-height: 1.3; }
html.pt-phone .mv-canvas .markmap-foreign .nd-t { flex-wrap: wrap; }
html.pt-phone .me-host me-root me-tpc { max-width: 124px !important; padding: 8px 10px !important; }
html.pt-phone .me-host .me-rt { font-size: 13.5px; }
html.pt-phone .me-host .me-rk { font-size: 10px; letter-spacing: .1em; }
html.pt-phone .me-host me-main > me-wrapper > me-parent > me-tpc { max-width: 138px; }
html.pt-phone .me-host me-children me-parent > me-tpc { max-width: 150px; }
html.pt-phone .me-host me-tpc .nd-title { white-space: normal; overflow-wrap: break-word; word-break: normal; hyphens: manual; }
html.pt-phone .me-host me-main > me-wrapper > me-parent > me-tpc, html.pt-phone .me-host me-root me-tpc { min-width: 104px; }
html.pt-landscape .me-host me-root me-tpc { max-width: 200px !important; }
html.pt-landscape .me-host me-main > me-wrapper > me-parent > me-tpc { max-width: 220px; }

/* ---- pulsante di apertura dei rami: numero dei figli (chiuso) o meno (aperto), colore del ramo. Desktop 20 px (area 28), touch 28-30 px (area 44) ---- */
.nd-x { position: relative; flex: 0 0 auto; align-self: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; border: 1.5px solid var(--c, var(--accent)); background: var(--card); color: var(--c, var(--accent)); font: 700 11px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: transform .12s; }
.nd-x::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.nd-x::after { content: "−"; }
.markmap-node.markmap-fold .nd-x::after { content: attr(data-n); }
.nd-x { transform: scale(var(--kinv, 1)); transform-origin: center; }
.nd-x:hover { transform: scale(calc(var(--kinv, 1) * 1.15)); }
.nd-x:active { transform: scale(calc(var(--kinv, 1) * .95)); }
html.pt-coarse .nd-x { width: 28px; height: 28px; font-size: 12.5px; }
html.pt-coarse .nd-x::before { inset: -8px; }
html.pt-coarse .mv-canvas .markmap-node > circle { display: none; }
.me-host .map-container me-parent me-epd { width: 20px; height: 20px; border-radius: 50%; background-image: none !important; background-color: var(--card); border: 1.5px solid var(--c, var(--text-2)); color: var(--c, var(--text-2)); opacity: 1; display: flex; align-items: center; justify-content: center; font: 700 11px/1 var(--font); box-sizing: border-box; cursor: pointer; transition: transform .12s, opacity .15s; z-index: 9; }
.me-host .map-container me-parent me-epd { transform: scale(var(--kinv, 1)); transform-origin: center; }
.me-host .map-container me-parent me-epd:hover { transform: scale(calc(var(--kinv, 1) * 1.15)); opacity: 1; }
.me-host .map-container me-parent me-epd.minus, .me-host .map-container me-parent me-epd.minus:hover { opacity: 1; }
.me-host .map-container me-parent me-epd::after { content: attr(data-n); }
.me-host .map-container me-parent me-epd.minus::after { content: "−"; }
.me-host .map-container me-parent me-epd::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.me-host .map-container me-epd, .me-host .map-container me-main > me-wrapper > me-parent > me-epd { top: calc(50% - 10px); }
.me-host .map-container .lhs me-epd, .me-host .map-container .lhs > me-wrapper > me-parent > me-epd { left: -12px; right: auto; }
.me-host .map-container .rhs me-epd, .me-host .map-container .rhs > me-wrapper > me-parent > me-epd { right: -12px; left: auto; }
html.pt-coarse .me-host .map-container me-parent me-epd { width: 30px; height: 30px; font-size: 13px; }
html.pt-coarse .me-host .map-container me-parent me-epd::before { inset: -7px; }
html.pt-coarse .me-host .map-container me-epd, html.pt-coarse .me-host .map-container me-main > me-wrapper > me-parent > me-epd { top: calc(50% - 15px); }
html.pt-coarse .me-host .map-container .lhs me-epd, html.pt-coarse .me-host .map-container .lhs > me-wrapper > me-parent > me-epd { left: -17px; }
html.pt-coarse .me-host .map-container .rhs me-epd, html.pt-coarse .me-host .map-container .rhs > me-wrapper > me-parent > me-epd { right: -17px; }

/* ---- racconto del tema: Lavagna (riquadro chiuso/aperto) e scheda Nodo ---- */
.bd-story { border-left: 4px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 6%, var(--card)); border-radius: 10px; padding: 8px 10px; }
.bd-story-h { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.bd-story-k { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c, var(--accent)); flex: 0 0 auto; }
.bd-story-first { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-story-btn { flex: 0 0 auto; }
.bd-story-full { display: none; margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.bd-story-full p { margin: 0 0 6px; }
.bd-story.open .bd-story-full { display: block; }
.bd-story.open .bd-story-first { display: none; }
html.pt-phone .bd-story-h { min-height: 44px; } html.pt-phone .bd-story-full { font-size: 15px; }
.mv-story { border-left: 4px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 6%, var(--card)); border-radius: 10px; padding: 8px 12px 6px; }
.mv-story .mv-sub { margin-top: 0; }
.mv-story-text p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
/* ---- scheda Nodo estesa: sottoalbero per esteso, annidato, con puntini del colore del ramo ---- */
.mv-nbody { overflow-wrap: anywhere; min-width: 0; }
.mv-nbody img { max-width: 100%; height: auto; }
.mv-nbody .mv-node-text { font-size: 14px; line-height: 1.55; }
.mv-node-sub { color: var(--text-2); }
.mv-tree { list-style: none; margin: 4px 0 0; padding: 0; }
.mv-tree .mv-tree { margin: 6px 0 2px 6px; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--c, var(--accent)) 30%, transparent); }
.mv-tree li { position: relative; margin: 0 0 10px; padding-left: 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.mv-tree li:last-child { margin-bottom: 4px; }
.mv-tree li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); }
.mv-tt { font-weight: 700; color: var(--text); text-decoration: none; }
.mv-tt:hover { color: var(--c, var(--accent)); text-decoration: underline; }
.mv-tt .ic { width: 14px; height: 14px; color: var(--c); }
.mv-tb { color: var(--text-2); }
.mv-tb::before { content: " – "; color: var(--muted); }
.mv-tnote { margin: 4px 0 2px; padding: 6px 9px; background: var(--accent-bg); border-radius: 8px; font-size: 13px; line-height: 1.45; color: var(--text); }
.mv-timg { display: block; width: 100%; max-width: 100%; height: auto; max-height: 180px; object-fit: cover; border-radius: 8px; margin: 6px 0 4px; cursor: zoom-in; box-shadow: var(--sh-sm); }
.mv-fig img { cursor: zoom-in; }
.mv-more { margin: 4px 0; }
.mv-more summary { cursor: pointer; color: var(--accent-fg); font-weight: 600; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 40px; }
.mv-more summary::-webkit-details-marker { display: none; }
.mv-more summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.mv-more[open] summary::before { transform: rotate(45deg); }
.mv-tts { font-family: var(--mono); font-size: 12px; color: var(--accent); cursor: pointer; margin-left: 4px; white-space: nowrap; }
.mv-tts:hover { text-decoration: underline; }
html.pt-phone .mv-tree li, html.pt-phone .mv-nbody .mv-node-text, html.pt-phone .mv-story-text p { font-size: 15px; }
html.pt-phone .mv-tnote { font-size: 14px; }

/* ---- collegamenti della Lavagna: solo a richiesta, sopra le card ---- */
.bd-links { display: none !important; }
.bd-card.linked::after { content: none !important; }
.bd-links-top { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 6; }
.bd-lk { color: var(--c, var(--accent)); }
.bd-lk path.bd-lk-line { fill: none; stroke: var(--c, var(--accent)); stroke-width: 2.5; stroke-linecap: round; }
.bd-lk-lbl rect { fill: var(--card); stroke: var(--c, var(--accent)); stroke-width: 1.2; }
.bd-lk-lbl text { fill: var(--text); font: 600 12px var(--font); }
.bd-host.links-on .bd-card:not(.lk-lit), .bd-host.links-on .bd-root, .bd-host.links-on .bd-sec, .bd-host.links-on .bd-story { opacity: .3; transition: opacity .2s; }
.bd-host.links-on .bd-group:not(.lk-grp) { opacity: .3; }
.bd-host.links-on .bd-group.lk-grp:not(.lk-lit) > .bd-gh { opacity: .6; }
.bd-card.lk-lit { box-shadow: 0 0 0 3px var(--c, var(--accent)), var(--sh-md); opacity: 1 !important; }
.bd-group.lk-lit { box-shadow: 0 0 0 3px var(--c, var(--accent)); }
.bd-lchip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--card)); color: var(--c, var(--accent)); font: 600 11.5px/1 var(--font); cursor: pointer; align-self: flex-start; }
.bd-lchip .lucide { width: 13px; height: 13px; }
.bd-lchip:hover { background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--card)); }
.bd-lchip.on { background: var(--c, var(--accent)); color: #fff; border-color: var(--c, var(--accent)); }
.bd-gh .bd-lchip { margin: 0 0 0 8px; }
html.pt-phone .bd-lchip { min-height: 32px; font-size: 12.5px; }
.mv-links { list-style: none; margin: 4px 0 0; padding: 0; }
.mv-links li { position: relative; padding: 8px 10px 8px 12px; margin: 0 0 6px; border-left: 3px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 6%, var(--card)); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.mv-lk { font-weight: 700; color: var(--text); text-decoration: none; }
.mv-lk:hover { color: var(--c, var(--accent)); text-decoration: underline; }
.mv-lk .ic { width: 14px; height: 14px; color: var(--c); }
.mv-lk-dir { margin-left: 6px; color: var(--c, var(--accent)); font-weight: 700; }
.mv-lk-rel { color: var(--text-2); font-size: 13px; margin-top: 2px; }
html.pt-phone .mv-links li { font-size: 15px; } html.pt-phone .mv-lk-rel { font-size: 14px; }

/* telefono, mappa mentale a due lati: il pulsante con il numero sta a cavallo del bordo esterno del nodo; spazio interno
   da quel lato, cosi' non copre il testo (lato destro: bordo destro; lato sinistro: bordo sinistro) */
html.pt-phone .me-host me-main.rhs me-parent > me-tpc { padding-right: 20px !important; }
html.pt-phone .me-host me-main.lhs me-parent > me-tpc { padding-left: 20px !important; }
