/* The layers of the management app («Tessera viva», pubblico/s/strati.js). Desktop: a centred deck; the cards below the
   top one move up and shrink a little, so they peek out above it. Phone: sheets from the bottom, the lower ones a
   little narrower and taller, peeking above; the handle drags the top sheet down to go back. Only the top layer is
   alive (the others are inert and veiled). Motion only to show what opened; none with reduced motion. */
html.st-aperto { overflow: hidden }

dialog.st { position: fixed; inset: auto; left: 50%; top: 50%; margin: 0; padding: 0; border: 0; box-sizing: border-box;
  width: min(36rem, calc(100vw - 48px)); max-width: none; height: auto; max-height: calc(100vh - 80px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--surface, #fff); color: var(--ink, #14161f);
  font: 400 16px/1.45 var(--font, 'Familjen Grotesk'), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 30px 80px -24px rgba(10, 14, 24, .55), 0 0 0 1px rgba(10, 14, 24, .07);
  transform: translate(-50%, -50%); transition: transform .28s cubic-bezier(.2, .8, .2, 1), filter .2s, height .2s }
dialog.st:not([open]) { display: none }
dialog.st.st--largo { width: min(62rem, calc(100vw - 48px)) }
dialog.st::backdrop { background: rgba(12, 14, 22, .52) }
dialog.st:not(.st--primo)::backdrop { background: transparent }
/* the cards below: up, a little smaller, veiled; tall enough to always show their top edge */
dialog.st.st--sotto { height: calc(100vh - 80px); transform: translate(-50%, calc(-50% - var(--su) * 1.75rem)) scale(calc(1 - var(--su) * .045)); filter: saturate(.85) }
dialog.st.st--sotto::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(20, 24, 34, .14); pointer-events: none }
dialog.st.st--entra { animation: st-entra .26s cubic-bezier(.2, .8, .2, 1) }
@keyframes st-entra { from { opacity: 0; transform: translate(-50%, calc(-50% + 24px)) scale(.97) } }

.st-carta { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0 }
.st-testa { flex: none; padding: 8.8px 12px 12px 16px; border-bottom: 1px solid var(--line, #e3e5eb); background: var(--surface, #fff) }
.st-maniglia { display: none; width: 44px; height: 5px; margin: 2px auto 8px; border-radius: 3px; background: #c6cad4 }
.st-barra { display: flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -8px }
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 10px; border: 0;
  border-radius: 10px; background: transparent; color: var(--ink-2, #4a5360); font-family: inherit; font-weight: 650; font-size: 16px; line-height: 1; cursor: pointer }
.st-btn:hover { background: rgba(20, 22, 31, .06) }
.st-btn[hidden] { display: none }
.st-x { margin-left: auto }
.st-briciole { min-width: 0 }
.st-briciole[hidden] { display: none }
.st-briciole ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--ink-3, #646a7a) }
.st-briciole li { display: inline-flex; align-items: center; min-width: 0 }
.st-briciole li + li::before { content: '/'; margin: 0 6px; color: #b5bac5 }
.st-briciole button { min-height: 44px; max-width: 15rem; padding: 0 4px; border: 0; background: none; color: var(--brand-primary); font-weight: 600; font-size: 14px; line-height: 1.2;
  font-family: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.st-briciole [aria-current] { color: var(--ink, #14161f); font-weight: 600; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.st-titolo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding-top: 2px }
.st-titolo h2 { margin: 0; font-size: 20.8px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em }
.st-titolo h2:focus { outline: none }
.st-titolo h2:focus-visible { outline: 3px solid var(--focus, #c2410c); outline-offset: 3px; border-radius: 4px }
.st-sopra { margin: 0; color: var(--ink-3, #636c78); font-size: 14.1px }
.st-sopra[hidden] { display: none }
.st-pagina { display: inline-flex; align-items: center; gap: 6.4px; min-height: 44px; margin-top: 4px; padding: 0 11.2px 0 8.8px; border: 1px solid var(--line, #e3e6ea);
  border-radius: 10px; color: var(--brand-primary) !important; font-weight: 650; font-size: 14.4px; text-decoration: none !important; background: var(--surface, #fff) }
.st-pagina:hover { border-color: var(--brand-primary) }
.st-pagina svg { width: 17px; height: 17px }
.st-corpo { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 17.6px 20px; background: var(--surface, #fff) }
.st-corpo[aria-busy=true] > * { opacity: .55; transition: opacity .15s }
.st-attesa { margin: 24px 0; color: var(--ink-3, #646a7a); text-align: center }
.st-lead { margin: 0 0 12px; color: var(--ink-3, #646a7a) }
/* inside a layer the head of a full page is the layer's own: its way back goes */
.st-corpo .sf-back, .st-corpo .page-head > div > p.muted:first-child:has(> a:only-child) { display: none }
.st-corpo .page-head { margin-bottom: 14px }
.st-corpo .page-head h1 { font-size: 20.8px }
.st-corpo > .flash:first-child { margin-top: 0 }
.st-corpo .card + .card { margin-top: 12px }

/* an outcome next to the button, with «Annulla» while it lasts */
.st-esito { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--ok-soft, #e6f4ec); color: #0e4f31; border: 1px solid color-mix(in srgb, var(--ok, #157347) 25%, transparent); font-weight: 600; font-size: 14.5px; line-height: 1.4 }
.st-esito > svg { flex: none }
.st-esito:focus { outline: none }
.st-esito:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-primary) 55%, white); outline-offset: 2px }
.st-esito--errore { background: var(--ko-soft, #fdecea); color: var(--ko, #b42318); border-color: color-mix(in srgb, var(--ko, #b42318) 25%, transparent) }
.st-esito--info { background: #eef1f6; color: var(--ink-2, #3c4150); border-color: #dde2ea }
.st-esito-t { flex: 1 1 14rem }
.gx .st-esito .st-annulla, .st-esito .st-annulla { min-height: 44px; background: #fff; border: 1.5px solid currentColor; color: inherit; font-size: 14px }
.st-annulla svg { width: 17px; height: 17px }
.is-busy { cursor: progress !important; opacity: .7 }
.st-arrivo { animation: st-arrivo 2.2s ease-out }
@keyframes st-arrivo { 0%, 40% { box-shadow: 0 0 0 4px var(--brand-accent) } 100% { box-shadow: none } }

/* «Annulla» in the message of a full page */
.gx .flash.info { background: #eef1f6; color: var(--ink-2); border: 1px solid #dde2ea }
.gx .flash { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px }
.gx .flash-annulla { margin: 0 0 0 auto }
.gx .flash-annulla .btn { min-height: 44px; background: #fff; border: 1.5px solid currentColor; color: inherit }

/* ------------------------------------------------------------------------------------------------ phone: sheets */
@media (max-width: 899px) {
  dialog.st, dialog.st.st--largo { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: calc(100dvh - 20px - var(--d, 0) * 18px);
    border-radius: 20px 20px 0 0; transform: none }
  dialog.st.st--sotto { transform: none; left: calc(var(--su) * 8px); right: calc(var(--su) * 8px); height: calc(100dvh - 20px - var(--d, 0) * 18px); filter: none }
  dialog.st.st--entra { animation: st-sale .3s cubic-bezier(.2, .8, .2, 1) }
  dialog.st.st--trascina { transition: none }
  .st-maniglia { display: block }
  .st-testa { touch-action: none; padding: 6px 10px 12px 16px }
  .st-briciole { display: none !important }
  .st-titolo h2 { font-size: 19px }
  .st-corpo { padding: 14px 14px 28px }
}
@keyframes st-sale { from { transform: translateY(40%); opacity: .4 } }

@media (prefers-reduced-motion: reduce) {
  dialog.st, dialog.st.st--entra, .st-arrivo { animation: none !important; transition: none !important }
}
