/* The member's record as the card («Tessera viva», viste/app/socio.php and its zones). The card is the one bold thing:
   drawn big in the gym's own colours, its name in the text face (wave 6, as the prototype), the holes of a carnet
   punched in the gym's accent. Everything around it is the quiet management app. Colours on the card follow
   --brand-on-primary, so a light gym colour gets dark text; warnings sit on their own pills, readable on any colour. */

/* ------------------------------------------------------------------------------------------------ card + right column */
.gx .ts { display: grid; grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); gap: 22.4px; align-items: start }
.gx .ts-head { margin-bottom: 18px }
@media (max-width: 1099px) { .gx .gx-main .ts { grid-template-columns: minmax(0, 1fr) } .gx .gx-main .ts-carta { max-width: 30rem } }
@media (max-width: 899px) { .gx .ts { grid-template-columns: minmax(0, 1fr); gap: 18px } }

/* ------------------------------------------------------------------------------------------------ the card */
/* as the prototype (wave 6): the gym's colour with a light diagonal and a fine weave, the accent corner, the chip and
   the state on top, the round initials, the name in the text face */
.tv { perspective: 1400px; color: var(--brand-on-primary) }
.tv-in { display: grid; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2, .8, .2, 1) }
.tv.tv--girata .tv-in { transform: rotateY(180deg) }
.tv-faccia { grid-area: 1 / 1; position: relative; overflow: hidden; border-radius: 20px; padding: 17.6px 17.6px 18.4px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background-color: var(--brand-primary);
  background-image: linear-gradient(115deg, color-mix(in srgb, currentColor 7%, transparent) 0 38%, transparent 38% 100%),
    repeating-linear-gradient(135deg, color-mix(in srgb, currentColor 3.5%, transparent) 0 2px, transparent 2px 9px);
  box-shadow: 0 18px 40px -18px rgba(10, 30, 40, .55), 0 2px 6px rgba(10, 30, 40, .18) }
/* the accent corner of a real card */
.tv-faccia::after { content: ''; position: absolute; right: 0; top: 0; width: 64px; height: 64px; background: var(--brand-accent); clip-path: polygon(0 0, 100% 0, 100% 100%); pointer-events: none }
/* the back takes the size of the front: its history scrolls inside */
.tv-retro { position: absolute; inset: 0; transform: rotateY(180deg); display: flex; flex-direction: column; gap: 10px }
.tv :focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px }
.tv-testa { position: relative; z-index: 1; display: flex; align-items: center; gap: 9.6px; min-height: 34px }
.tv-chip { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-accent); color: var(--brand-on-accent);
  font-weight: 700; font-size: 14.4px; letter-spacing: .02em; object-fit: cover }
.tv-marchio { max-height: 30px; max-width: 120px; width: auto; height: auto; display: block }
.tv-palestra { font-weight: 700; font-size: 15.2px; letter-spacing: .01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tv-stato { margin-left: auto; margin-right: 41.6px; display: inline-flex; align-items: center; padding: 2.4px 10.4px; border-radius: 999px; flex: none;
  background: color-mix(in srgb, var(--brand-on-primary) 95%, transparent); color: var(--brand-primary); font-weight: 700; font-size: 13.6px }
.tv-chi { position: relative; z-index: 1; display: flex; align-items: center; gap: 13.6px; margin: 17.6px 0 16px }
.tv-foto { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, currentColor 50%, transparent); background: color-mix(in srgb, currentColor 16%, transparent) }
.tv-foto--iniziali { font-weight: 700; font-size: 17.6px }
.tv-foto-tap { position: relative; flex: none; padding: 0; border: 0; background: none; color: inherit; border-radius: 50%; cursor: pointer; min-width: 44px; min-height: 44px }
.tv-foto-ico { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-on-primary); color: var(--brand-primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .3) }
.tv-nomi { min-width: 0 }
.tv-nome { margin: 0; font-weight: 700; font-size: 26.4px; line-height: 1.05; letter-spacing: -.02em; overflow-wrap: anywhere }
.tv-num { margin: 3.2px 0 0; font-size: 13.6px; opacity: .85; font-variant-numeric: tabular-nums }
.tv-zone { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8.8px }
.tv-zona { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3.2px; min-height: 88px; padding: 9.6px 38.4px 10.4px 11.2px; border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent); background: color-mix(in srgb, currentColor 9%, transparent);
  color: inherit !important; text-decoration: none !important; transition: background .15s, border-color .15s }
a.tv-zona:hover { background: color-mix(in srgb, currentColor 16%, transparent); border-color: color-mix(in srgb, currentColor 55%, transparent) }
.tv-z-et { font-size: 12.5px; font-weight: 650; opacity: .85 }
.tv-z-val { font-weight: 700; font-size: 15.7px; line-height: 1.25; overflow-wrap: anywhere }
.tv-z-sub { font-size: 13.1px; line-height: 1.3; opacity: .9; overflow-wrap: anywhere }
.tv-z-mat { position: absolute; right: 8.8px; top: 8.8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, currentColor 14%, transparent) }
.tv-zona--chiusa { opacity: .8 }
/* warnings: the border and the tint of the prototype; the line itself on its own pill, readable whatever the gym's colour */
.tv-zona--attenta { border-color: #ffd27a; background: color-mix(in srgb, #ffd27a 14%, transparent) }
.tv-zona--grave { border-color: #ff9d94; background: color-mix(in srgb, #ff786e 16%, transparent) }
.tv-zona--attenta .tv-z-sub, .tv-zona--grave .tv-z-sub { opacity: 1; padding: 1px 7px; border-radius: 6px; font-weight: 700 }
.tv-zona--attenta .tv-z-sub { background: #fff4dc; color: #6f4700 }
.tv-zona--grave .tv-z-sub { background: #fdecea; color: #a11d12 }
/* the holes of a carnet: the entries left are punched in the gym's accent */
.tv-buchi, .zi-buchi, .mu-buchi { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 }
.tv-buchi i, .zi-buchi i, .mu-buchi i { display: block; width: 15px; height: 15px; border-radius: 50%; background: var(--brand-accent) }
.tv-buchi i.usato { background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 55%, transparent) }
/* the back: the history */
.tv-reg { position: relative; z-index: 1; list-style: none; margin: 4px 0 0; padding: 0 4px 0 0; display: grid; align-content: start; gap: 8.8px; overflow: auto; flex: 1 1 auto; min-height: 0 }
.tv-reg li { display: grid; gap: 1.6px; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); font-size: 14.7px; line-height: 1.35 }
.tv-reg-q { font-size: 12.5px; opacity: .8 }
.tv-reg-vuoto { position: relative; z-index: 1; margin: 12px 0 }
.tv-reg-tutto { position: relative; z-index: 1; color: inherit !important; font-weight: 700; text-decoration: underline !important; text-underline-offset: 3px;
  min-height: 44px; display: inline-flex; align-items: center; margin-top: auto }
.tv-sotto { margin: 12px 0 0 }
.tv-gira svg { flex: none }
@media (max-width: 47.99rem) {
  .tv-nome { font-size: 22.4px }
  .tv-zona { min-height: 80px }
}

/* every target of the card, its zones and its layers is at least 44px (the base .btn.small is smaller) */
dialog.st .btn, .gx .ts .btn, .gx .ts-sezioni .btn, .gx .st-zona .btn, .gx .sg .btn, .gx .sg-lista .btn, .gx .tg .btn, .gx .mu-pagine .btn,
.gx .sd-matita, .gx .tv-gira { min-height: 44px }

/* ------------------------------------------------------------------------------------------------ the right column */
.gx .ts-tre { margin: 0; display: grid; gap: 7.2px }
.gx .ts-tre > div { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 8px }
.gx .ts-tre dt { color: var(--ink-3); font-size: 13.1px; font-weight: 650; padding-top: 1.6px }
.gx .ts-tre dd { margin: 0; font-size: 15.2px; line-height: 1.45 }
.gx .ts-esiti:empty { display: none }
.gx .ts-mossa, .gx .ts-azioni, .gx .ts-ultime { margin-top: 17.6px }
.gx .ts-mossa h2, .gx .ts-azioni h2, .gx .ts-ultime h2 { margin: 0 0 8px; font-size: 15.2px; font-weight: 700; color: var(--ink) }
.gx .ts-mossa-testo { margin: 0 0 9.6px; font-size: 15.2px; line-height: 1.45; color: var(--ink) }
.gx .ts-az { display: grid; gap: 3.2px; min-width: 0 }
.gx .ts-btn { width: 100%; justify-content: space-between; text-align: left; min-height: 44px; padding: 8px 16px; line-height: 1.25; border-radius: var(--radius) }
.gx .ts-btn.ghost { border-color: var(--line-2); color: var(--ink) }
.gx .ts-btn--primaria { min-height: 52px; font-size: 16.8px; padding: 9.6px 19.2px; border-radius: var(--radius); justify-content: flex-start }
.gx .ts-btn-ico { flex: none; opacity: .8 }
.gx .ts-btn--no[aria-disabled=true], .gx .ts-btn--no[aria-disabled=true]:hover { background: #f1f3f5; color: #6b7480; border: 1px dashed #b5bcc6; cursor: not-allowed; filter: none; box-shadow: none; text-decoration: none }
.gx .vd-link.ts-btn--no[aria-disabled=true] { padding: 0 12px; border-radius: 10px; font: 600 14px/1 var(--font) }
.gx .ts-perche { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 0 4px; font-size: 13.4px; line-height: 1.4; color: var(--ink-3) }
.gx .ts-perche svg { flex: none; margin-top: 2px }
.gx .ts-nota { margin: 0 0 0 2px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2) }
.gx .ts-nota:empty { display: none }
.gx .ts-card-box { display: grid; gap: 4px }
.gx .ts-ingresso { display: grid; gap: 6px; margin: 0 }
.gx .ts-ingresso label { margin: 0; font-size: 13.5px }
.gx .ts-ingresso select { width: 100% }
.gx .ts-gruppo { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 4px 8px; padding: 7.2px 0; border-top: 1px solid var(--line) }
.gx .ts-gruppo h3 { margin: 0; padding-top: 12.8px; font-size: 12.8px; font-weight: 650; color: var(--ink-3) }
.gx .ts-gruppo-az { display: grid; gap: 4.8px; min-width: 0 }
.gx .ts-conferma { min-width: 0 }
.gx .ts-conferma > summary { list-style: none; cursor: pointer }
.gx .ts-conferma > summary::-webkit-details-marker { display: none }
.gx .ts-conferma[open] > summary { border-color: color-mix(in srgb, var(--ko) 40%, var(--line)); color: var(--ko) }
.gx .ts-conferma-in { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--ko-soft); border: 1px solid color-mix(in srgb, var(--ko) 22%, transparent) }
.gx .ts-conferma-in p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.45 }
.gx .ts-conferma-in form { margin: 0 }
.gx .ts-righe { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.gx .ts-righe li { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.4 }
.gx .ts-righe li:last-child { border-bottom: 0 }
.gx .ts-righe time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 1px }
.gx .ts-righe small { display: block; color: var(--ink-3); font-size: 12.5px }
.gx .ts-vuoto { margin: 0 }
@media (max-width: 560px) {
  .gx .ts-gruppo { grid-template-columns: minmax(0, 1fr) }
  .gx .ts-gruppo h3 { padding-top: 2px }
  .gx .ts-tre > div { grid-template-columns: minmax(0, 1fr); gap: 0 }
  .gx .ts-righe li { grid-template-columns: 5.4rem minmax(0, 1fr) }
}

/* ------------------------------------------------------------------------------------------------ the full page below */
.gx .ts-sezioni { margin-top: 28px }
.gx .ts-sez-testa { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px }
.gx .ts-sez-testa h2 { margin: 0 }
.gx .ts-sezioni > .card:target, .gx .ts-sezioni > section:target { animation: st-arrivo 2.2s ease-out }

/* ------------------------------------------------------------------------------------------------ zones and groups */
.gx .st-zona.cols { margin-top: 0 }
.gx .zi-conta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 6px }
.gx .zi-conta b { font: 700 32px/1 var(--font); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--brand) }
.gx .zi-conta span { color: var(--ink-3) }
.gx .zi-buchi { margin: 4px 0 14px }
.gx .zi-buchi i { width: 18px; height: 18px }
.gx .zi-buchi i.usato { background: transparent; box-shadow: inset 0 0 0 2px #c3c8d1 }
.gx .zi .card + .card { margin-top: 14px }

/* the record's data, group by group */
.gx .sd { display: grid; gap: 4px }
.gx .sd-gruppo { padding: 12px 0; border-top: 1px solid var(--line) }
.gx .sd-gruppo:first-child { border-top: 0; padding-top: 0 }
.gx .sd-testa { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap }
.gx .sd-testa h3 { margin: 0; font-size: 15.5px }
.gx .sd-testa small { color: var(--ink-3); font-size: 13px }
.gx .sd-matita { margin-left: auto; display: inline-flex; align-items: center; gap: 6px }
.gx .sd-dati { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; font-size: 15px }
.gx .sd-dati > div { display: contents }
.gx .sd-dati dt { color: var(--ink-3); font-size: 14px }
.gx .sd-dati dd { margin: 0; overflow-wrap: anywhere }
.gx .sd-manca { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px }
@media (max-width: 560px) { .gx .sd-dati { grid-template-columns: minmax(0, 1fr); gap: 0 } .gx .sd-dati dd { margin-bottom: 6px } }

/* one group's form */
.gx .sg-manca { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600 }
.gx .sg-manca svg { flex: none; margin-top: 1px }
.gx .sg-vuoto { margin: 14px 0 0; color: var(--ink-3); font-size: 14px }
.gx .sg textarea { width: 100% }
.gx .sg-togli { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #c9ced8 }
.gx .sg-togli h2 { font-size: 15px; color: var(--ink-3); margin: 0 0 8px }
.gx .sg-lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px }
.gx .sg-lista li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px 8px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface) }
.gx .sg-lista li > span { display: grid; min-width: 0 }
.gx .sg-lista small { color: var(--ink-3); font-size: 13.5px; overflow-wrap: anywhere }
.gx .sg-lista .st-esito { flex-basis: 100% }

/* «Togli»: what goes, what follows */
.gx .tg-cosa { display: grid; gap: 2px; margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--bg) }
.gx .tg-cosa span { color: var(--ink-3); font-size: 13.5px }
.gx .tg-cosa b { font-size: 16px; overflow-wrap: anywhere }
.gx .tg .sf-actions { margin-top: 16px }
.gx .vd-cert-vuoto { grid-column: 1 / -1; margin: 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.4 }
.gx .vd-cert-off { flex-wrap: wrap; margin-top: 10px }
.gx .vd-cert-off .vd-link { min-height: 44px }
.gx .vd-cert-off .ts-perche { flex-basis: 100%; margin-top: 0 }
.gx .vd-cert-off .st-esito { flex-basis: 100% }

/* ------------------------------------------------------------------------------------------------ the wall of mini-cards */
/* as the prototype (wave 6): a band in the gym's colour with its chip, the code and the state; the white body below */
.gx .mu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 16px }
.gx .mu-li { min-width: 0 }
.gx .mu-carta { display: flex; flex-direction: column; height: 100%; min-height: 9.5rem; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--ink) !important; text-decoration: none !important; box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, transform .15s }
.gx .mu-carta:hover { border-color: var(--brand); transform: translateY(-1px) }
.gx .mu-banda { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; background: var(--brand); color: var(--on-brand);
  font-size: 12.5px; font-weight: 650; line-height: 1.2 }
.gx .mu-carta--spento .mu-banda { background: #5b6470; color: #fff }
.gx .mu-chip-palestra { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--on-accent);
  font-size: 9.9px; font-weight: 700; letter-spacing: .02em; object-fit: cover }
.gx .mu-foto { flex: none; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px color-mix(in srgb, currentColor 60%, transparent) }
.gx .mu-cod { font-variant-numeric: tabular-nums; letter-spacing: .01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.gx .mu-stato { margin-left: auto; flex: none; padding: .8px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 16%, transparent); white-space: nowrap }
.gx .mu-corpo { display: grid; align-content: start; gap: 4.8px; padding: 11.2px 12.8px 12.8px; min-width: 0 }
.gx .mu-nome { font-size: 17.9px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere }
.gx .mu-riga { font-size: 14.1px; line-height: 1.45; color: var(--ink-2) }
.gx .mu-carnet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0 }
.gx .mu-carta .mu-buchi { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 }
.gx .mu-carta .mu-buchi i { width: 12px; height: 12px; background: var(--accent); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .15) }
.gx .mu-carta .mu-buchi i.usato { background: transparent; box-shadow: inset 0 0 0 1.5px #b5bcc6 }
.gx .mu-buchi-et { margin-left: 4.8px; font-size: 12.8px; color: var(--ink-3) }
.gx .mu-avviso { display: inline-flex; align-items: center; gap: 5.6px; font-size: 13.4px; font-weight: 650; line-height: 1.35; color: var(--warn) }
.gx .mu-avviso svg { flex: none }
.gx .mu-avviso--ko { color: var(--ko) }
.gx .mu-avviso--ok { color: var(--ok) }
.gx .mu-vuoto { padding: 32px 16px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: 14px; margin: 0 }
.gx .mu-pagine { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px }
.gx .mu-pagine:empty { display: none }
.gx [data-mu-zona][aria-busy=true] { opacity: .6; transition: opacity .15s }
@media (max-width: 47.99rem) { .gx .mu { grid-template-columns: minmax(0, 1fr); gap: 12px } .gx .mu-pagine .btn { flex: 1 } }

@media (prefers-reduced-motion: reduce) {
  .tv-in, .gx .mu-carta, .gx .ts-sezioni > .card:target { transition: none !important; animation: none !important }
}
.gx .st-zona .vd-more, .gx .ts-sezioni .vd-more { display: inline-flex; align-items: center; min-height: 44px }

/* ------------------------------------------------------------------------------------------------ «Cancella del tutto»
   (Domain\Cancellazione): the consequences, then the full name typed to confirm */
.gx .sc-canc-cosa { padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid color-mix(in srgb, var(--ko) 25%, var(--line)) }
.gx .sc-canc-cosa p { margin: 0 0 6px }
.gx .sc-canc-cosa ul { margin: 0 0 8px; padding-left: 1.2em }
.gx .sc-canc-cosa li { margin: 4px 0; overflow-wrap: anywhere }
.gx .sc-canc-form { display: grid; gap: 8px; margin-top: 14px }
.gx .sc-canc-form label { overflow-wrap: anywhere }
.gx .sc-canc-form input { min-height: 44px; width: 100% }
.gx .sc-canc-form .sf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px }
.gx .sc-canc-form .sf-actions .btn { flex: 1 1 200px; min-height: 44px }
