:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #17191a;
  --testo-2: #5f6466;
  --testo-3: #a3a8aa;
  --linea: #e9ecec;
  --traccia: #f4f6f6;
  --accento: #13806b;        /* the single accent: deep sea green, in the index, the tags and the marked lines */
  --accento-scuro: #0d5f4f;
  --accento-velo: #e6f3ef;
  --accento-segno: #cdeae1;  /* the marker behind the changed lines */
  --ombra: 18, 32, 30;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(10px, min(2.3vw, 2.35vh), 16px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }

.stage { height: 100vh; display: grid; place-items: center; padding: .8em; }

/* ---- the card ---- */
.terms {
  width: min(48em, 94vw);
  max-height: calc(100vh - 1.6em);
  display: flex; flex-direction: column;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 1.3em;
  padding: 1.35em 1.4em 1.1em;
  box-shadow: 0 1px 2px rgba(var(--ombra), .05), 0 26px 50px -34px rgba(var(--ombra), .35);
}

.terms__head { flex: none; padding-bottom: 1em; border-bottom: 1px solid var(--linea); }
.brand { display: flex; align-items: center; gap: .4em; font-size: .8em; font-weight: 620; color: var(--testo-2); letter-spacing: .01em; }
.brand svg { width: 1.45em; height: 1.45em; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand .brand__soft { stroke: #9fcfc3; }
.terms__title { margin-top: .35em; font-size: 1.62em; font-weight: 660; font-stretch: 106%; letter-spacing: -.015em; line-height: 1.1; }
.terms__meta { margin-top: .55em; display: flex; align-items: center; flex-wrap: wrap; gap: .5em .8em; }
.terms__date { font-size: .82em; color: var(--testo-2); }

/* «What changed»: a quiet pill that fills with the tint when on */
.changes { border-radius: 999px; outline: none; }
.changes__face {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .32em .4em .32em .8em;
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: var(--carta);
  font-size: .8em; font-weight: 580; font-stretch: 100%;
  color: var(--testo);
  transition: border-color .3s, background-color .3s, color .3s;
}
.changes__count {
  min-width: 1.6em; height: 1.6em; padding: 0 .4em;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--traccia);
  font-size: .9em; font-weight: 640; font-variant-numeric: tabular-nums;
  transition: background-color .3s, color .3s;
}
.changes[aria-pressed="true"] .changes__face { border-color: #bfe0d6; background: var(--accento-velo); color: var(--accento-scuro); }
.changes[aria-pressed="true"] .changes__count { background: var(--accento); color: #fff; }
.changes:focus-visible .changes__face { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accento); }

/* ---- body: index + list ---- */
.terms__body { flex: 1; min-height: 0; display: grid; grid-template-columns: 10.5em 1fr; gap: 1.4em; padding-top: 1em; }

.index { position: relative; align-self: start; display: flex; flex-direction: column; gap: .1em; }
.index__item {
  position: relative; z-index: 1;
  padding: .52em .8em;
  font-size: .84em; color: var(--testo-2);
  border-radius: .55em;
  white-space: nowrap;
  outline: none;
  transition: color .3s;
}
.index__item.is-on { color: var(--accento-scuro); font-weight: 600; }
.index__item:focus-visible { box-shadow: inset 0 0 0 1.5px var(--accento); }
.index__marker {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  border-radius: .55em;
  background: var(--accento-velo);
  opacity: 0;
  pointer-events: none;
}
.index__marker::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 2px; border-radius: 2px;
  background: var(--accento);
}

.list {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--linea) transparent;
  padding-right: .2em;
}

.sec { border-bottom: 1px solid var(--linea); }
.sec:last-child { border-bottom: 0; }
.sec__h { font: inherit; }
.sec__btn {
  width: 100%;
  display: flex; align-items: center; gap: .6em;
  padding: .78em .3em .78em .2em;
  border-radius: .6em;
  outline: none;
}
.sec__btn:focus-visible { box-shadow: inset 0 0 0 1.5px var(--accento); }
.sec__name { font-size: 1em; font-weight: 580; font-stretch: 102%; letter-spacing: -.005em; transition: color .3s; }
.sec.is-open .sec__name { color: var(--accento-scuro); }
.tag {
  font-size: .68em; font-weight: 620; letter-spacing: .05em; text-transform: uppercase;
  color: var(--testo-3);
  border: 1px solid var(--linea);
  border-radius: 999px;
  padding: .18em .55em;
  transition: color .3s, border-color .3s, background-color .3s;
}
.terms.is-changes .tag { color: var(--accento-scuro); border-color: #bfe0d6; background: var(--accento-velo); }
.sec__chev { margin-left: auto; flex: none; width: 1.05em; height: 1.05em; fill: none; stroke: var(--testo-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.sec__panel { height: 0; overflow: hidden; }
.sec__inner { padding: 0 .2em 1em; display: grid; gap: .65em; }
.plain {
  font-size: .9em; line-height: 1.45; color: var(--testo);
  background: var(--traccia);
  border-radius: .75em;
  padding: .7em .85em;
}
.plain__k { display: block; margin-bottom: .2em; font-size: .78em; font-weight: 620; letter-spacing: .05em; text-transform: uppercase; color: var(--accento); }
.legal { font-size: .78em; line-height: 1.55; color: var(--testo-2); padding: 0 .2em; }

/* the changed lines: a soft marker that sweeps in from the left (background-size), not an underline */
.mark {
  color: inherit;
  background-image: linear-gradient(var(--accento-segno), var(--accento-segno));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% 100%;
  border-radius: .2em;
  padding: 0 .1em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: color .3s;
}
.terms.is-changes .mark { color: var(--testo); }

/* ---- the phone: the index becomes a row of pills above the list ---- */
@media (max-width: 620px) {
  .terms { padding: 1.1em 1em .8em; }
  .terms__body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: .6em; padding-top: .7em; }
  .index {
    flex-direction: row; gap: .15em;
    overflow-x: auto; scrollbar-width: none;
    margin: 0 -1em; padding: 0 1em;
  }
  .index::-webkit-scrollbar { display: none; }
  .index__item { padding: .45em .8em; border-radius: 999px; font-size: .8em; }
  .index__marker { border-radius: 999px; }
  .index__marker::before { display: none; }
}

@media (hover: hover) {
  .index__item:hover { color: var(--testo); }
  .sec__btn:hover .sec__name { color: var(--accento-scuro); }
  .changes:hover .changes__face { border-color: #cfd6d6; }
}
