@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-serif-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("../fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); }

:root {
  /* grigi freddi a più livelli: pagina, pannelli, fogli bianchi */
  --paper: #e8ecf0;
  --panel: #f3f5f7;
  --sheet: #ffffff;
  --ink: #1b2330;
  --muted: #566272;
  --line: #d3d9e0;
  --line-strong: #b4bec9;
  --slate: #1c2b3b;
  --slate-2: #2a3d52;
  --accent: #1f5673;
  --accent-soft: #e2ecf2;
  --mark: #f6e6bd;
  --mark-ink: #654709;
  --danger: #8f2d2d;
  --week: #15414d;
  --week-gold: #e8bd62;
  --shadow: 0 1px 2px rgba(27, 35, 48, 0.06), 0 6px 18px rgba(27, 35, 48, 0.06);
  --radius: 6px;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
}

a { color: var(--accent); }

a:hover { color: #12332d; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.8rem;
  z-index: 5;
}

.skip:focus { top: 0.5rem; }

.site-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(8px);
}

.brand {
  text-decoration: none;
  color: inherit;
  min-width: 10rem;
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
}

.search {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  max-width: 36rem;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 1px solid #c9c0b0;
  background: white;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  color: inherit;
}

.search input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.search button,
.profiles button,
.node,
.pager a {
  font: inherit;
  cursor: pointer;
}

.search button {
  border: 0;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 0.7rem 1rem;
}

.nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.5rem 0;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.nav a[aria-current="page"] {
  background: var(--accent);
  color: white;
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.lede h1,
.section-head h1,
.search-head h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}

.kicker {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 0.4rem;
  position: sticky;
  top: 5.4rem;
  z-index: 2;
  background: var(--paper);
  padding: 0.35rem 0;
}

.profiles button {
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.profiles button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.status {
  min-height: 1.4rem;
  color: var(--mark-ink);
  margin: 0.4rem 0 1rem;
}

.map-sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.center-note {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.center-note strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  display: block;
}

.branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.branch {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: #fbfaf6;
}

.branch h2 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 0.6rem;
}

.nodes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.node {
  text-align: left;
  border: 1px solid var(--line);
  background: white;
  color: inherit;
  padding: 0.55rem 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.node[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.node.is-on {
  background: var(--mark);
  border-color: #e0c59a;
}

.tag {
  color: var(--mark-ink);
  font-size: 0.75rem;
  white-space: nowrap;
}

.detail {
  margin-top: 0.8rem;
  padding: 1rem 1.1rem 1.15rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 8rem;
}

.detail h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 0 0 0.4rem;
}

.detail p { margin: 0.4rem 0; }

.who {
  color: var(--muted);
}

.archive {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.1rem;
  scroll-margin-top: 6rem;
}

.card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.card h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0;
}

.when {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.righe {
  margin: 0.8rem 0;
  padding: 0;
  list-style: none;
}

.righe li {
  padding: 0.15rem 0 0.15rem 0.8rem;
  border-left: 2px solid #e4d3b4;
  margin: 0.35rem 0;
}

.chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0 0 0.7rem;
}

.chips span {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  color: var(--muted);
}

.out {
  font-weight: 650;
}

.hits { display: flex; flex-direction: column; gap: 0.8rem; }

.hit {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
}

.hit .kind {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.hit h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0.2rem 0;
}

.hit p { margin: 0.3rem 0; }

.empty { color: var(--muted); }

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.site-footer p { margin: 0.3rem 0; }

@media (max-width: 800px) {
  .site-header { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .map-button { text-align: center; }
  .search { max-width: none; }
  .branches { grid-template-columns: 1fr; }
  .card header { flex-direction: column; }
  .when { white-space: normal; }
}

/* ---------- aggiunte fase 2 ---------- */

.map-button {
  text-decoration: none;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  white-space: nowrap;
  font-weight: 600;
}
.map-button:hover, .map-button[aria-current="page"] { background: var(--accent); color: white; }

.map-link { font-weight: 600; }

.node .tag { display: none; }
.node.is-on .tag { display: inline; }

.node-detail h2, .node-detail h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
.node-detail h4 {
  margin: 1.1rem 0 0.3rem;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.node-detail p { margin: 0.45rem 0; }
.link-list { margin: 0.2rem 0 0.4rem; padding-left: 1.1rem; }
.link-list li { margin: 0.2rem 0; }
.link-list .note { color: var(--muted); font-size: 0.92rem; }
.linkish {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.linked-group .group-title { margin: 0.5rem 0 0; font-weight: 600; }
.other-view { margin-top: 1rem; }

.count { color: var(--muted); margin: 0.2rem 0 1.2rem; }

.card.is-target { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.card.is-presidio { border-left: 4px solid #c99a4d; }
.chips .chip-presidio { background: var(--mark); color: var(--mark-ink); border-color: #e0c59a; }
.card-nodes { color: var(--muted); font-size: 0.92rem; margin: 0.5rem 0 0; }
.ai-note { color: var(--muted); font-size: 0.85rem; font-style: italic; margin: 0.4rem 0 0; }

.more {
  font: inherit;
  margin: 1.2rem 0 0;
  border: 1px solid var(--accent);
  background: var(--sheet);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

.hits-title { font-family: var(--serif); font-size: 1.35rem; margin: 1.6rem 0 0.3rem; }
.hits-note { color: var(--muted); margin: 0 0 0.8rem; }
.hit.is-presidio { border-left: 4px solid #c99a4d; }
.hit h2 a { color: inherit; }

.footer-links a { color: var(--muted); }

/* note legali e privacy */
.legal { max-width: 46rem; }
.legal h2 { font-family: var(--serif); font-size: 1.35rem; margin: 1.8rem 0 0.4rem; }
.legal p, .legal li { line-height: 1.6; }
.legal-date { color: var(--muted); margin-top: 2rem; font-size: 0.92rem; }
.da-definire { background: #fde68a; color: #5b3b00; padding: 0 0.25rem; }

/* ---------- mappa grafica ---------- */
.mm-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: start;
}
.mm-stage {
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.mm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.mm-toolbar button {
  font: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  color: var(--ink);
}
.mm-toolbar button:hover { border-color: var(--accent); }
.mm-sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 0.25rem; }
.mm-canvas { position: relative; }
.mm-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 5;
  max-height: 80vh;
  touch-action: none;
  cursor: grab;
  user-select: none;
  background: #fffdf8;
}
.mm-svg:active { cursor: grabbing; }

.mm-edge { fill: none; }
.mm-tree { stroke: #c4b8a3; stroke-width: 1.8; }
.mm-cross { stroke: #1e4a42; stroke-opacity: 0.22; stroke-width: 1.4; stroke-dasharray: 6 5; }
.mm-sec { stroke: #8a6a35; stroke-opacity: 0; stroke-width: 1.4; stroke-dasharray: 2 5; }
.mm-tree.is-lit { stroke: var(--accent); stroke-width: 2.6; }
.mm-cross.is-lit { stroke-opacity: 0.95; stroke-width: 2.4; }
.mm-sec.is-lit, .mm-sec.is-hover { stroke-opacity: 0.75; }

.mm-item { cursor: pointer; outline: none; }
.mm-item text { font-family: var(--sans); font-size: 17px; fill: var(--ink); pointer-events: none; }
.mm-item rect { stroke-width: 1.3; }
.mm-item:focus-visible rect { stroke: #000; stroke-width: 3; }

.mm-center rect { fill: var(--accent); stroke: var(--accent); }
.mm-center text { fill: white; font-family: var(--serif); font-size: 19px; font-weight: 700; }
.mm-hub rect { fill: var(--accent-soft); stroke: var(--accent); }
.mm-hub text { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.mm-hub.is-selected rect { stroke-width: 3; }
.mm-node rect { fill: white; stroke: #cfc5b4; }
.mm-node:hover rect { stroke: var(--accent); }
.mm-node .mm-dot { display: none; fill: var(--mark-ink); }
.mm-node.is-on rect { fill: var(--mark); stroke: #d9b67a; }
.mm-node.is-on .mm-dot { display: inline; }
.mm-node.is-linked rect { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 3; }
.mm-node.is-selected rect { stroke: var(--accent); stroke-width: 3.5; stroke-dasharray: none; }
.mm-section rect { fill: #fbfaf6; stroke: #8a6a35; stroke-dasharray: 5 4; }
.mm-section text { font-weight: 600; fill: #5b4320; }
.mm-section:hover rect, .mm-section.is-linked rect { fill: #f6ead3; stroke-dasharray: none; }

.mm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  align-items: center;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.lg { display: inline-block; width: 1.6rem; height: 0; vertical-align: middle; margin-right: 0.25rem; }
.lg-tree { border-top: 2px solid #c4b8a3; }
.lg-cross { border-top: 2px dashed #1e4a42; opacity: 0.6; }
.lg-sec { border-top: 2px dotted #8a6a35; }
.lg-on { height: 0.8rem; width: 1rem; background: var(--mark); border: 1px solid #d9b67a; }

.mm-detail {
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.2rem;
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  scroll-margin-top: 7rem;
  outline: none;
}
.mm-index {
  margin-top: 1.2rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 0.7rem 1rem;
}
.mm-index summary { cursor: pointer; font-weight: 600; }
.mm-index h3 { font-family: var(--serif); margin: 0.9rem 0 0.2rem; }

@media (max-width: 800px) {
  .mm-layout { grid-template-columns: 1fr; }
  .mm-svg { height: 72vh; aspect-ratio: auto; }
  .site-header { position: static; }
  .mm-detail { position: static; max-height: none; }
  .profiles { top: 0; position: static; }
}

/* pagina della mappa grafica: più larga, profili non fissi */
body[data-page="grafica"] main { width: min(1440px, calc(100% - 2rem)); }
body[data-page="grafica"] .profiles { position: static; }
.mm-layout { grid-template-columns: minmax(0, 1fr) 21rem; }
@media (max-width: 800px) { .mm-layout { grid-template-columns: 1fr; } }

/* ---------- rete norme e soggetti ---------- */
.rn-edge { stroke: #b9ad98; stroke-width: 1.4; }
.rn-edge.is-lit { stroke: var(--accent); stroke-width: 2.4; }
.rn-arrow-head { fill: #b9ad98; }
.rn-arrow-head.lit { fill: var(--accent); }
.rn-label { display: none; font-family: var(--sans); font-size: 13px; fill: #12332d; paint-order: stroke; stroke: #fffdf8; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.rn-label.is-lit { display: inline; }
.rn-node rect { stroke-width: 1.4; }
.rn-node text { font-size: 14.5px; }
.rn-norma > g > rect:first-child { fill: #ffffff; stroke: #8fa7a0; }
.rn-norma .rn-band { fill: #2f5d8a; stroke: none; }
.rn-norma.rn-it .rn-band { fill: #2e7d4f; }
.rn-istituzione > g > rect:first-child { fill: #f1e3c6; stroke: #b8925a; }
.rn-destinatario > g > rect:first-child { fill: #f7f5f0; stroke: #8b8478; stroke-dasharray: 5 4; }
.rn-node.is-on > g > rect:first-child { fill: var(--mark); stroke: #d9b67a; }
.rn-node.is-linked > g > rect:first-child { stroke: var(--accent); stroke-width: 2.2; }
.rn-node.is-selected > g > rect:first-child { stroke: var(--accent); stroke-width: 4; }
.rn-node.is-far { opacity: 0.55; }
.rn-node:hover > g > rect:first-child { stroke: var(--accent); }
.rn-more circle { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.rn-more text { fill: #fff; font-size: 10.5px; font-weight: 700; }
.rn-rels li { margin: 0.35rem 0; }
.mm-selected { margin: 0; padding: 0.45rem 0.8rem 0.6rem; font-size: 0.9rem; color: var(--muted); }
.mm-selected:empty { display: none; }
.lg-norma-ue { height: 0.8rem; width: 1rem; background: #fff; border: 1px solid #8fa7a0; border-left: 4px solid #2f5d8a; }
.lg-norma-it { height: 0.8rem; width: 1rem; background: #fff; border: 1px solid #8fa7a0; border-left: 4px solid #2e7d4f; }
.lg-ist { height: 0.8rem; width: 1.2rem; background: #f1e3c6; border: 1px solid #b8925a; border-radius: 999px; }
.lg-dest { height: 0.8rem; width: 1.2rem; background: #f7f5f0; border: 1px dashed #8b8478; border-radius: 999px; }
.lg-more { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.75rem; text-align: center; line-height: 1.1rem; font-weight: 700; }
@media (min-width: 801px) { .mm-svg { aspect-ratio: 4 / 3; } }

.mm-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); background: var(--paper); }
.mm-trail:empty { display: none; }
.mm-trail .linkish { font-size: inherit; text-decoration: none; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 0.15rem 0.6rem; }
.mm-trail .linkish:hover, .mm-trail .linkish:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.mm-trail strong { background: var(--accent); color: #fff; border-radius: 999px; padding: 0.15rem 0.6rem; font-weight: 600; }
.mm-toolbar .mm-indietro { font-weight: 600; border-color: var(--accent); color: var(--accent); }
.mm-toolbar .mm-indietro:disabled { opacity: 0.45; cursor: default; border-color: var(--line); color: var(--muted); }
.mm-torna:empty { display: none; }
.mm-torna { margin: 0 0 0.6rem; }
.mm-torna-btn { font: inherit; font-size: 0.92rem; cursor: pointer; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 999px; padding: 0.3rem 0.8rem; text-align: left; }
.mm-torna-btn:hover, .mm-torna-btn:focus-visible { background: #fff; }
.mm-back { display: none; }
.mm-all .mm-back { display: inline-block; }

/* ---------- tema di attualità ---------- */
.tema-banner {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--sheet);
  border: 1px solid #e0c59a;
  border-left: 6px solid #c99a4d;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.4rem;
  box-shadow: var(--shadow);
}
.tema-banner strong { display: block; font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; margin: 0.15rem 0 0.35rem; }
.tema-banner .tema-cta { color: var(--accent); font-weight: 600; }
.tema-banner:hover { border-color: var(--accent); }
.tema {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 1.1rem 1.25rem 1.2rem;
  margin: 0 0 1rem;
  scroll-margin-top: 6rem;
}
.tema.is-current { border-left: 6px solid #c99a4d; box-shadow: var(--shadow); }
.tema h2 { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; margin: 0.1rem 0 0.6rem; }
.tema h3 { margin: 1.2rem 0 0.35rem; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.tema-list { margin: 0; padding-left: 1.2rem; }
.tema-list li { margin: 0.4rem 0; line-height: 1.55; }
.tema summary { cursor: pointer; font-family: var(--serif); font-size: 1.15rem; }
.tema-date { color: var(--muted); font-family: var(--sans); font-size: 0.95rem; }
.tipo-fonte { color: var(--muted); font-size: 0.9rem; }

/* ---------- casi pratici e illeciti ---------- */
.quick-links { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.6rem; }
.quick-links a { display: block; height: 100%; text-decoration: none; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); padding: 0.7rem 0.9rem; }
.quick-links a:hover, .quick-links a:focus-visible { border-color: var(--accent); }
.quick-links strong { display: block; color: var(--accent); font-size: 1.05rem; margin-bottom: 0.15rem; }
.quick-links span { color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.avvertenza { background: var(--mark); color: var(--mark-ink); padding: 0.6rem 0.8rem; font-size: 0.93rem; line-height: 1.5; }
.verificato { color: var(--muted); font-size: 0.85rem; margin: 0.6rem 0 0; }
.casi { margin-top: 1rem; }
.caso, .illecito { background: var(--sheet); border: 1px solid var(--line); padding: 0.9rem 1.15rem; margin: 0 0 0.8rem; scroll-margin-top: 6rem; }
.caso summary { cursor: pointer; font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; }
.caso[open] { border-left: 6px solid var(--accent); box-shadow: var(--shadow); }
.caso h3 { margin: 1.1rem 0 0.35rem; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.caso .in-breve { font-size: 1.05rem; line-height: 1.6; }
.tema-list.check { list-style: none; padding-left: 0; }
.tema-list.check li { padding-left: 1.5rem; position: relative; }
.tema-list.check li::before { content: "✓"; position: absolute; left: 0.1rem; color: var(--accent); font-weight: 700; }
.attenzione { border-left: 4px solid var(--danger); background: #f8ebe7; padding: 0.55rem 0.8rem; line-height: 1.5; }
.illeciti-gruppo { margin: 1.6rem 0 0; }
.illeciti-gruppo > h2 { font-family: var(--serif); font-size: 1.6rem; margin: 0 0 0.3rem; }
.illecito h3 { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; margin: 0.1rem 0 0.4rem; }
.illecito .fonti { margin-top: 0.5rem; }
.salti { margin: 0.8rem 0; font-size: 0.95rem; }
.caso[hidden], .illecito[hidden], .illeciti-gruppo[hidden] { display: none; }

/* ---------- mappa: gesti e schermo intero ---------- */
/* Fuori dallo schermo intero: un dito o la rotella fanno scorrere la pagina, la mappa si muove con due dita o Ctrl + rotella. */
.mm-svg { touch-action: pan-x pan-y; }
.mm-ico { vertical-align: -3px; margin-right: 0.3rem; }
.mm-toolbar .mm-full-on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.mm-toolbar .mm-full-off { display: none; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.mm-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; max-width: min(26rem, calc(100% - 2rem)); padding: 0.7rem 1rem;
  background: rgba(28, 25, 21, 0.86); color: #fff; border-radius: 10px;
  font-size: 0.95rem; line-height: 1.45; text-align: center; pointer-events: none;
}
.mm-hint[hidden] { display: none; }
.mm-detail-chiudi { display: none; }

html.mm-noscroll, html.mm-noscroll body { overflow: hidden; overscroll-behavior: none; }
.mm-layout.mm-full {
  position: fixed; inset: 0; z-index: 1000; margin: 0; gap: 0;
  height: 100vh; height: 100dvh;
  grid-template-columns: minmax(0, 1fr) 22rem; grid-template-rows: minmax(0, 1fr);
  align-items: stretch; background: var(--paper);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.mm-full .mm-stage { display: flex; flex-direction: column; min-height: 0; border: 0; box-shadow: none; }
.mm-full .mm-canvas { flex: 1 1 auto; min-height: 0; }
.mm-full .mm-svg { height: 100%; max-height: none; aspect-ratio: auto; touch-action: none; }
.mm-full .mm-detail { position: static; height: 100%; max-height: none; border-width: 0 0 0 1px; box-shadow: none; overscroll-behavior: contain; }
.mm-full .mm-toolbar .mm-full-on { display: none; }
.mm-full .mm-toolbar .mm-full-off { display: inline-flex; align-items: center; margin-left: auto; }

@media (max-width: 800px) {
  .mm-layout.mm-full { grid-template-columns: minmax(0, 1fr); }
  .mm-full .mm-toolbar { padding: 0.4rem; gap: 0.25rem; }
  .mm-full .mm-toolbar button { font-size: 0.82rem; padding: 0.25rem 0.6rem; }
  .mm-full .mm-trail { padding: 0.35rem 0.6rem; font-size: 0.85rem; flex-wrap: nowrap; overflow-x: auto; }
  .mm-full .mm-trail > * { flex: none; }
  .mm-full .mm-legend { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
  .mm-full .mm-selected { padding: 0.45rem 0.7rem; background: var(--accent-soft); color: var(--ink); }
  .mm-full .mm-detail {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 1001;
    height: auto; max-height: 64dvh; padding-top: 0;
    border-width: 1px 0 0; border-radius: 14px 14px 0 0; box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.2);
    transform: translateY(105%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .mm-full .mm-detail.is-open { transform: none; visibility: visible; transition: transform 0.25s ease; }
  .mm-full .mm-detail-chiudi {
    display: block; position: sticky; top: 0; z-index: 1; width: calc(100% + 2.2rem); margin: 0 -1.1rem 0.6rem;
    padding: 0.7rem 1.1rem; border: 0; border-bottom: 1px solid var(--line); background: var(--sheet);
    font: inherit; font-weight: 600; color: var(--accent); text-align: right; cursor: pointer;
  }
}
@media (prefers-reduced-motion: reduce) { .mm-full .mm-detail { transition: none; } }


/* =================================================================
   Tema visivo: grigi a livelli, testata scura, sezioni con un colore
   ================================================================= */

/* colore di ogni sezione: tab di navigazione, intestazione, bordo delle schede */
[data-sez="index"], body[data-page="index"] { --c: #1c2b3b; }
[data-sez="attualita"], body[data-page="attualita"] { --c: #15414d; }
[data-sez="casi"], body[data-page="casi"] { --c: #a2541a; }
[data-sez="illeciti"], body[data-page="illeciti"] { --c: #8f2d2d; }
[data-sez="normativa"], body[data-page="normativa"] { --c: #1f5673; }
[data-sez="pronunce"], body[data-page="pronunce"] { --c: #5a4a8c; }
[data-sez="notizie"], body[data-page="notizie"] { --c: #2d7a6a; }
[data-sez="formazione"], body[data-page="formazione"] { --c: #866710; }
[data-sez="strumenti"], body[data-page="strumenti"] { --c: #4a5a6c; }
body[data-page="grafica"], body[data-page="ricerca"], body[data-page="note-legali"], body[data-page="privacy"] { --c: #1f5673; }

body { font-size: 1.02rem; line-height: 1.55; }
h1, h2, h3, .card h2, .hit h2, .branch h2, .detail h3, .node-detail h2, .node-detail h3, .tema h2, .caso summary, .illecito h3 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em;
}
.lede h1, .section-head h1, .search-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -0.015em; line-height: 1.12; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: #123a4f; }
:focus-visible { outline: 3px solid #3b8fc0; outline-offset: 2px; }

/* etichette: niente maiuscolo spaziato, solo colore e peso */
.kicker, .hit .kind, .node-detail h4, .tema h3, .caso h3 {
  text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 0.92rem; color: var(--c, var(--accent));
}
.chips span { text-transform: none; letter-spacing: 0; background: var(--panel); border-color: var(--line); color: var(--muted); font-size: 0.8rem; }

/* testata scura */
.site-header { background: var(--slate); border-bottom: 0; color: #fff; backdrop-filter: none; }
.brand strong { color: #fff; font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.brand span { color: #b7c3cf; }
.search input { background: #fff; border-color: transparent; }
.search input:focus { outline: 3px solid #3b8fc0; border-color: transparent; }
.search button { background: #3a7aa0; font-weight: 600; }
.search button:hover { background: #2f6789; }
.map-button { background: transparent; border: 1px solid #8ea3b8; color: #fff; }
.map-button:hover, .map-button[aria-current="page"] { background: #fff; color: var(--slate); border-color: #fff; }

/* navigazione: banda grigia, tab con il colore della sezione */
.nav {
  background: #d9dfe6; border-bottom: 1px solid var(--line-strong);
  padding: 0 1.25rem; gap: 0.1rem;
}
.nav a {
  border-radius: 0; padding: 0.7rem 0.8rem 0.65rem; border-top: 3px solid transparent;
  color: #26313f; font-size: 0.95rem;
}
.nav a::before {
  content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 2px;
  background: var(--c); margin-right: 0.45rem; vertical-align: 0.05em;
}
.nav a:hover { background: #e9edf1; }
.nav a[aria-current="page"] { background: var(--sheet); color: var(--ink); font-weight: 600; border-top-color: var(--c); }

/* intestazioni di sezione su foglio bianco con il filo colorato */
.section-head, .search-head {
  background: var(--sheet); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--accent));
  border-radius: var(--radius); padding: 1.2rem 1.4rem 1.1rem; margin-bottom: 1.2rem; box-shadow: var(--shadow);
}
.section-head .intro, .search-head .intro { margin-bottom: 0.2rem; }
.intro { color: var(--muted); }

/* schede e risultati */
.card, .hit, .tema, .caso, .illecito { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { border-left: 4px solid var(--c, var(--accent)); }
.card h2 { font-size: 1.3rem; }
.righe li { border-left-color: #c3cdd8; }
.card.is-presidio, .hit.is-presidio { border-left: 4px solid #c9952e; }
.card.is-target { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.more { background: var(--sheet); border-radius: 999px; font-weight: 600; }
.more:hover { background: var(--accent-soft); }

/* profili */
.profiles { background: var(--paper); }
.profiles button { background: var(--sheet); border-color: var(--line-strong); }
.profiles button:hover { border-color: var(--accent); }
.profiles button[aria-pressed="true"] { background: var(--slate); border-color: var(--slate); }
.status { color: var(--muted); }

/* home: introduzione a sinistra, tema della settimana a destra */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); gap: 1.25rem; align-items: stretch; margin-bottom: 0.4rem; }
.home-hero.no-week { grid-template-columns: 1fr; }
.home-hero .lede { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.6rem 1.4rem; }
.home-hero .lede .intro { max-width: 40rem; margin: 0 0 1.1rem; }
.quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; gap: 0.6rem; }
.quick-links a { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 0.7rem 0.85rem; }
.quick-links a:hover, .quick-links a:focus-visible { background: #fff; border-color: var(--line-strong); border-left-color: var(--c); }
.quick-links strong { color: var(--c); font-size: 1rem; }
.quick-links span { font-size: 0.9rem; }
.ql-mappa { --c: var(--accent); }
.ql-casi { --c: #a2541a; }
.ql-illeciti { --c: #8f2d2d; }

.week {
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--week); color: #e9f1f3; border-radius: var(--radius);
  padding: 1.35rem 1.45rem 1.4rem; box-shadow: var(--shadow);
  border-top: 5px solid var(--week-gold);
}
.week-label { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; margin: 0; font-size: 0.9rem; }
.week-label span:first-child { color: var(--week-gold); font-weight: 600; }
.week-date { color: #a9c1c8; }
.week h2 { color: #fff; font-size: 1.42rem; line-height: 1.25; margin: 0.1rem 0 0; }
.week-text { margin: 0; color: #d3e1e5; line-height: 1.5; }
.week-meta { margin: 0; color: #a9c1c8; font-size: 0.9rem; }
.week-cta {
  margin-top: auto; align-self: flex-start; text-decoration: none; font-weight: 600;
  background: var(--week-gold); color: #1b2330; padding: 0.6rem 1.05rem; border-radius: 999px;
}
.week-cta:hover, .week-cta:focus-visible { background: #f3d189; color: #1b2330; }

/* quadro a rami */
.map-sheet { border-radius: var(--radius); }
.center-note { border: 0; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.branch { background: var(--panel); border-color: var(--line); border-radius: var(--radius); }
.branch h2 { font-size: 1.15rem; padding-bottom: 0.45rem; border-bottom: 2px solid var(--line); }
.node { border-color: var(--line); border-radius: 4px; }
.node:hover { border-color: var(--accent); }
.detail { background: var(--sheet); }

/* tema, casi, illeciti */
.tema.is-current, .caso[open] { border-left: 6px solid var(--c, var(--accent)); }
.tema.is-current { border-top: 4px solid var(--week-gold); }
.illecito { border-left: 4px solid var(--c, var(--accent)); }
.illeciti-gruppo > h2 { padding: 0.35rem 0 0.35rem 0.8rem; border-left: 6px solid var(--c); }
.caso summary { font-weight: 600; }
.caso:not([open]):hover { border-color: var(--line-strong); }
.avvertenza { background: #fbf2dc; color: #5d430b; border-left: 4px solid #c9952e; border-radius: 0 var(--radius) var(--radius) 0; }
.attenzione { background: #f9eceb; border-left-color: var(--danger); }
.tema-list.check li::before { color: var(--c, var(--accent)); }

/* mappa di orientamento */
.mm-stage, .mm-detail, .mm-index { border-radius: var(--radius); }
.mm-full .mm-stage, .mm-full .mm-detail { border-radius: 0; }
.mm-toolbar, .mm-legend { background: var(--panel); }
.mm-svg { background: #fbfcfd; }
.mm-trail { background: #eef1f4; }
.mm-toolbar button { background: #fff; border-color: var(--line-strong); }

/* piede scuro a tutta larghezza */
.site-footer {
  width: auto; margin: 3rem 0 0; border-top: 0; background: var(--slate); color: #b7c3cf;
  padding: 1.6rem max(1rem, calc((100% - 1120px) / 2)) 2rem;
}
.site-footer .footer-links a, .site-footer a { color: #e3e9ef; }
main { margin-bottom: 0; }

/* note legali */
.legal { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.6rem 1.6rem; max-width: 50rem; }
.legal .section-head { border: 0; border-left: 0; box-shadow: none; padding: 1.4rem 0 0.6rem; margin: 0; border-bottom: 2px solid var(--line); border-radius: 0; }

@media (max-width: 1000px) {
  .quick-links { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero .week { order: -1; }
  .week h2 { font-size: 1.25rem; }
  .nav { padding: 0 0.5rem; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .nav a { white-space: nowrap; flex: none; }
  .section-head, .search-head { padding: 1rem 1rem 0.9rem; }
  .legal { padding: 0 1rem 1rem; }
}
.mm-lede {
  background: var(--sheet); border: 1px solid var(--line); border-left: 6px solid var(--accent);
  border-radius: var(--radius); padding: 1.1rem 1.4rem 0.9rem; box-shadow: var(--shadow); margin-bottom: 0.4rem;
}
.mm-lede h1 { margin-bottom: 0.3rem; }
.mm-lede .intro { margin: 0 0 0.5rem; max-width: 52rem; }

/* selettore del profilo, uguale in tutto il sito */
.profiles { align-items: center; gap: 0.5rem 0.7rem; }
.profiles-label { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.profile-buttons { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.profiles button[aria-pressed="true"][data-profile]:not([data-profile=""]) { background: var(--mark); color: var(--mark-ink); border-color: #c9952e; font-weight: 600; }
.status .linkish { font-weight: 600; }
.rn-node.is-on > g > rect:first-child { stroke: #c9952e; stroke-width: 2.6; }
.rn-node.is-off { opacity: 0.28; }
.rn-node.is-off:hover, .rn-node.is-off:focus-visible { opacity: 0.8; }
.rn-edge.is-off { opacity: 0.25; }
/* nella mappa il profilo sta dentro il riquadro, sopra i comandi: vale anche a schermo intero */
.mm-profili { padding: 0.55rem 0.8rem 0.1rem; border-bottom: 1px solid var(--line); background: #fff; }
.mm-profili .profiles { position: static; margin: 0; padding: 0; background: transparent; }
.mm-profili .status { margin: 0.35rem 0 0.45rem; min-height: 0; font-size: 0.9rem; }
.mm-profili .profiles button { padding: 0.3rem 0.8rem; font-size: 0.92rem; }
@media (max-width: 800px) {
  .mm-full .mm-profili { padding: 0.35rem 0.5rem 0; }
  .mm-full .mm-profili .status { display: none; }
  .mm-full .mm-profili .profiles-label { display: none; }
  .mm-full .mm-profili .profiles button { font-size: 0.8rem; padding: 0.2rem 0.6rem; }
}

/* =================================================================
   Colori di sezione: ogni sezione ha il suo fondo pastello, ripreso
   dalla tab di navigazione, così il lettore associa colore e contenuto
   ================================================================= */
body { --bg: var(--paper); background: var(--bg); }
[data-sez="index"], body[data-page="index"] { --c: #2c3e52; --bg: #eceff3; }
[data-sez="attualita"], body[data-page="attualita"] { --c: #1d6391; --bg: #e3f1fa; }
[data-sez="casi"], body[data-page="casi"] { --c: #a2541a; --bg: #fbefe3; }
[data-sez="illeciti"], body[data-page="illeciti"] { --c: #8f2d2d; --bg: #f8e9e9; }
[data-sez="normativa"], body[data-page="normativa"] { --c: #2f4f8f; --bg: #e7ecf8; }
[data-sez="pronunce"], body[data-page="pronunce"] { --c: #5a4a8c; --bg: #eeeaf6; }
[data-sez="notizie"], body[data-page="notizie"] { --c: #24735f; --bg: #e3f3ed; }
[data-sez="formazione"], body[data-page="formazione"] { --c: #7d6210; --bg: #f7f1dd; }
[data-sez="strumenti"], body[data-page="strumenti"] { --c: #4c6339; --bg: #ecf2e6; }
body[data-page="grafica"], body[data-page="ricerca"], body[data-page="note-legali"], body[data-page="privacy"] { --c: #1f5673; --bg: #eceff3; }

/* la tab della sezione aperta prende il fondo della pagina: tab e pagina sono un tutt'uno */
.nav a[aria-current="page"] { background: var(--bg); }
.nav a:hover { background: color-mix(in srgb, var(--bg) 70%, #fff); }
.profiles { background: var(--bg); }

/* le scorciatoie della home ripetono il colore della sezione a cui portano */
.quick-links a { background: var(--bg); }
.quick-links a:hover, .quick-links a:focus-visible { background: #fff; }
.ql-mappa { --c: #1f5673; --bg: #eceff3; }
.ql-casi { --c: #a2541a; --bg: #fbefe3; }
.ql-illeciti { --c: #8f2d2d; --bg: #f8e9e9; }

/* home: tema della settimana in un riquadro laterale azzurro, circa un terzo della larghezza */
.home-hero { grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); }
.week {
  --c: #1d6391;
  background: #dcedf9; color: var(--ink);
  border: 1px solid #b4d3ea; border-top: 5px solid #2b7bb0;
  box-shadow: var(--shadow);
}
.week-label span:first-child { color: #1d6391; }
.week-date { color: #4f6b80; }
.week h2 { color: #14324a; }
.week-text { color: #263c4f; }
.week-meta { color: #4f6b80; }
.week-cta { background: #1f6a9a; color: #fff; }
.week-cta:hover, .week-cta:focus-visible { background: #17557d; color: #fff; }
.tema.is-current { border-top-color: #2b7bb0; }
.tema-list a.out { overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .week { padding: 1rem 1.1rem 1.1rem; }
  .week-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* =================================================================
   Filtro del profilo: fascia sotto la testata, sempre visibile
   ================================================================= */
.site-header { z-index: 20; }
.profile-strip {
  position: sticky; top: 0; z-index: 19;
  display: flex; justify-content: flex-end;
  background: var(--slate-2); border-top: 1px solid #3a5068;
  padding: 0.45rem 1.5rem 0.5rem;
}
.profile-strip[hidden] { display: none; }
@media (min-width: 801px) { .profile-strip { top: var(--hh, 5.8rem); } }
.profile-strip .profiles { position: static; margin: 0; padding: 0; background: transparent; gap: 0.5rem 0.7rem; }
.profile-strip .profiles-label { color: #d5dee8; font-size: 0.9rem; }
.profile-strip .profiles button {
  background: transparent; color: #fff; border: 1px solid #7f95ab;
  padding: 0.28rem 0.85rem; font-size: 0.9rem;
}
.profile-strip .profiles button:hover { border-color: #fff; }
.profile-strip .profiles button[aria-pressed="true"] { background: #fff; color: var(--slate); border-color: #fff; font-weight: 600; }
.profile-strip .profiles button[aria-pressed="true"][data-profile]:not([data-profile=""]) { background: var(--mark); color: var(--mark-ink); border-color: var(--mark); }
.status { margin: 0.2rem 0 1rem; }
/* nella mappa: i pulsanti dentro il riquadro servono solo a schermo intero, dove la fascia non si vede */
.mm-profili-pieno { display: none; }
.mm-full .mm-profili-pieno { display: block; padding-bottom: 0.3rem; }
.mm-profili { padding-top: 0.45rem; }
@media (max-width: 800px) {
  .profile-strip { justify-content: flex-start; padding: 0.4rem 0.6rem; }
  .profile-strip .profiles-label { display: none; }
  .profile-strip .profile-buttons { flex-wrap: nowrap; overflow-x: auto; gap: 0.35rem; }
  .profile-strip .profiles button { flex: none; font-size: 0.85rem; padding: 0.25rem 0.7rem; }
}

/* =================================================================
   Mappa di orientamento: finestra a tutto schermo con navigazione
   ================================================================= */
body[data-page="grafica"] .mm-lede, body[data-page="grafica"] main > .mm-index { display: none; }
.mm-nav {
  display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap;
  background: var(--slate); color: #fff; padding: 0.55rem 0.9rem;
}
.mm-nav-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-right: auto; }
.mm-nav-steps { display: flex; gap: 0.4rem; }
.mm-nav button {
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: 0.35rem 0.95rem;
  background: transparent; color: #fff; border: 1px solid #8ea3b8;
}
.mm-nav button:hover:not(:disabled), .mm-nav button:focus-visible { background: #fff; color: var(--slate); border-color: #fff; }
.mm-nav button:disabled { opacity: 0.4; cursor: default; }
.mm-nav .mm-chiudi { background: #fff; color: var(--slate); border-color: #fff; }
.mm-nav .mm-chiudi:hover, .mm-nav .mm-chiudi:focus-visible { background: var(--mark); color: var(--mark-ink); border-color: var(--mark); }
.mm-full .mm-nav { flex: none; }
@media (max-width: 800px) {
  .mm-nav { padding: 0.4rem 0.5rem; gap: 0.35rem; }
  .mm-nav-title { display: none; }
  .mm-nav-steps { margin-right: auto; }
  .mm-nav button { font-size: 0.85rem; padding: 0.3rem 0.7rem; }
}

/* =================================================================
   Mappa: l'area esplorabile occupa tutta la finestra; comandi fluttuanti
   ================================================================= */
.mm-layout.mm-full { display: block; padding: 0; }
.mm-full .mm-stage { position: absolute; inset: 0; display: block; border: 0; border-radius: 0; box-shadow: none; background: #fbfcfd; }
.mm-full .mm-canvas { position: absolute; inset: 0; }
.mm-full .mm-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; touch-action: none; background: #fbfcfd; }

/* barra in alto: passi e strumenti a sinistra, chiudi a destra; trasparente sopra la mappa */
.mm-full .mm-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  background: transparent; padding: max(0.6rem, env(safe-area-inset-top)) 0.7rem 0.6rem;
  pointer-events: none;
}
.mm-full .mm-nav > * { pointer-events: auto; }
.mm-full .mm-nav-title { display: none; }
.mm-full .mm-nav-steps { margin-right: auto; display: flex; gap: 0.35rem; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem; box-shadow: var(--shadow); }
.mm-full .mm-nav-steps button { background: transparent; color: var(--ink); border: 0; padding: 0.3rem 0.75rem; font-size: 0.88rem; font-weight: 600; }
.mm-full .mm-nav-steps button:hover:not(:disabled), .mm-full .mm-nav-steps button:focus-visible { background: var(--accent-soft); color: var(--ink); }
.mm-full .mm-nav-steps button:disabled { opacity: 0.35; }
.mm-full .mm-nav-steps .mm-strumenti-btn[aria-expanded="true"] { background: var(--slate); color: #fff; }
.mm-full .mm-nav .mm-chiudi {
  background: var(--slate); color: #fff; border: 0; font-size: 1rem; padding: 0.55rem 1.15rem;
  box-shadow: 0 4px 14px rgba(27, 35, 48, 0.3);
}
.mm-full .mm-nav .mm-chiudi:hover, .mm-full .mm-nav .mm-chiudi:focus-visible { background: #8f2d2d; color: #fff; }

/* zoom in basso a destra */
.mm-zoom { display: none; }
.mm-full .mm-zoom {
  position: absolute; right: 0.8rem; bottom: max(0.9rem, env(safe-area-inset-bottom)); z-index: 3;
  display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.mm-zoom button { font: inherit; font-size: 1.25rem; line-height: 1; width: 2.6rem; height: 2.6rem; border: 0; background: transparent; cursor: pointer; color: var(--ink); }
.mm-zoom button + button { border-top: 1px solid var(--line); }
.mm-zoom button:hover, .mm-zoom button:focus-visible { background: var(--accent-soft); }

/* nodo selezionato: etichetta in basso a sinistra che apre il dettaglio */
.mm-full .mm-selected {
  position: absolute; left: 0.8rem; bottom: max(0.9rem, env(safe-area-inset-bottom)); z-index: 3;
  margin: 0; padding: 0; background: transparent; max-width: calc(100% - 5rem);
}
.mm-chip {
  font: inherit; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; max-width: 100%;
  background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 0.45rem 0.8rem; box-shadow: var(--shadow); color: var(--ink); text-align: left;
}
.mm-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-chip-label { color: var(--muted); font-size: 0.82rem; }
.mm-chip-cta { color: var(--accent); font-weight: 600; white-space: nowrap; font-size: 0.9rem; }
.mm-chip:hover, .mm-chip:focus-visible { border-color: var(--accent); }

/* pannello Strumenti: profilo, vista, percorso, legenda */
.mm-full .mm-pannello {
  position: absolute; top: 3.6rem; left: 0.7rem; z-index: 4; width: min(24rem, calc(100% - 1.4rem));
  max-height: calc(100% - 8rem); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 34px rgba(27, 35, 48, 0.22);
  padding: 0.3rem 1rem 1rem;
}
.mm-pannello[hidden] { display: none !important; }
.mm-pannello-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.mm-pannello-chiudi { font: inherit; border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; padding: 0.2rem 0.4rem; }
.mm-pannello h3 { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 0.9rem 0 0.35rem; }
.mm-pannello .mm-profili { padding: 0; border: 0; background: transparent; }
.mm-pannello .mm-profili-pieno { display: block; }
.mm-pannello .profiles-label { display: none; }
.mm-pannello .mm-toolbar { padding: 0; border: 0; background: transparent; }
.mm-pannello .mm-trail { padding: 0; border: 0; background: transparent; }
.mm-pannello .mm-legend { padding: 0; border: 0; background: transparent; font-size: 0.85rem; }
.mm-pannello .status { font-size: 0.88rem; margin: 0.4rem 0 0; }

/* dettaglio: cassetto a destra (computer) o dal basso (telefono), chiuso finché non si apre */
.mm-full .mm-detail {
  position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 5;
  width: min(27rem, 92vw); height: auto; max-height: none; border-radius: 0; border-width: 0 0 0 1px;
  box-shadow: -14px 0 34px rgba(0, 0, 0, 0.18); padding-top: 0;
  transform: translateX(105%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s;
}
.mm-full .mm-detail.is-open { transform: none; visibility: visible; transition: transform 0.25s ease; }
.mm-full .mm-detail-chiudi {
  display: block; position: sticky; top: 0; z-index: 1; width: calc(100% + 2.2rem); margin: 0 -1.1rem 0.6rem;
  padding: 0.75rem 1.1rem; border: 0; border-bottom: 1px solid var(--line); background: var(--sheet);
  font: inherit; font-weight: 600; color: var(--accent); text-align: right; cursor: pointer;
}
@media (max-width: 800px) {
  .mm-full .mm-detail {
    top: auto; left: 0; right: 0; width: auto; max-height: 70dvh; border-width: 1px 0 0; border-radius: 14px 14px 0 0;
    box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.2); transform: translateY(105%);
  }
  .mm-full .mm-detail.is-open { transform: none; }
  .mm-full .mm-nav-steps button { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
  .mm-full .mm-nav .mm-chiudi { padding: 0.45rem 0.85rem; font-size: 0.9rem; }
  .mm-full .mm-pannello { top: 3.3rem; max-height: calc(100% - 7.5rem); }
  .mm-chip-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mm-full .mm-detail { transition: none; } }
.mm-full .mm-pannello .mm-profili .status { display: block; }
.mm-full .mm-pannello .profiles button { font-size: 0.88rem; padding: 0.28rem 0.75rem; }
