:root {
  --bg: #050608;
  --ink: #eef2f7;
  --mute: rgba(238, 242, 247, .52);
  --faint: rgba(255, 255, 255, .04);
  --line: rgba(255, 255, 255, .08);
  --ok: #34d399;
  --warn: #f87171;
  --blue: #60a5fa;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.4 "Geist", system-ui, sans-serif;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 2px solid rgba(96, 165, 250, .7); outline-offset: 2px; }
.ph-light { line-height: 1; }

.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 0% 0%, rgba(37, 99, 235, .16), transparent 70%),
    radial-gradient(50% 35% at 100% 100%, rgba(16, 185, 129, .10), transparent 70%),
    radial-gradient(40% 30% at 100% 20%, rgba(96, 165, 250, .05), transparent 70%);
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--top) + 18px) 16px calc(var(--bot) + 120px);
}

/* motion */
.anim .rise { animation: rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }
@keyframes grow { from { transform: scaleX(0); } }

/* type */
.eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute); display: flex; align-items: center; gap: 8px;
}
.pill { display: inline-flex; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--faint); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.sec {
  display: flex; align-items: center; gap: 8px; margin: 30px 4px 12px;
  font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--mute);
}
.sec b { font: 500 11px "Geist Mono", monospace; padding: 2px 8px; border-radius: 99px; background: var(--faint); color: var(--ink); }

/* double bezel */
.shell { padding: 6px; border-radius: 28px; background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .06); }
.core {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01)), #0a0c11;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

/* buttons */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 6px 0 24px; border-radius: 99px;
  background: var(--ink); color: var(--bg); font-weight: 600;
  transition: transform .5s var(--ease);
}
.cta b {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg); color: var(--ink); font-size: 18px;
  transition: transform .5s var(--ease);
}
.cta:active { transform: scale(.98); }
.cta:hover b, .cta:active b { transform: translateX(2px) scale(1.05); }
.wide { width: 100%; }
.loading { pointer-events: none; }
.loading b i { display: none; }
.loading b::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.icon-btn.loading i, .tools .loading i { animation: spin .9s linear infinite; }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 22px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--faint); color: var(--ink);
  transition: transform .5s var(--ease);
}
.ghost i { font-size: 20px; }
.ghost:active, .icon-btn:active, .tap:active { transform: scale(.97); }
.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--faint); font-size: 20px;
  transition: transform .5s var(--ease), background .3s var(--ease);
}
.icon-btn.sm { width: 36px; height: 36px; font-size: 16px; color: var(--mute); }

/* inputs */
/* :where → specificità 0: .search/.pw/.day-l input possono sovrascrivere padding */
:where(input:not([type=checkbox], [type=radio]), textarea) {
  display: block; width: 100%; min-width: 0; min-height: 52px; padding: 14px 18px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--faint);
  font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
input::placeholder, textarea::placeholder { color: rgba(238, 242, 247, .35); }
input:focus, textarea:focus { border-color: rgba(96, 165, 250, .55); background: rgba(96, 165, 250, .05); }
textarea { resize: none; min-height: 76px; }
input[type=date], input[type=time] { text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }

/* boot / auth */
.boot { min-height: 80dvh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; color: var(--mute); }
.crest {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px;
  background: linear-gradient(145deg, rgba(96, 165, 250, .22), rgba(52, 211, 153, .12));
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 20px 50px -20px rgba(37, 99, 235, .6);
  font-size: 30px; color: var(--ink);
}
.pulse { animation: pulse 1.6s var(--ease) infinite; }
.auth { min-height: calc(100dvh - var(--top) - var(--bot) - 60px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth .pill { align-self: flex-start; margin-top: 10px; }
.brand { margin: 0 0 14px; font-size: clamp(38px, 11vw, 48px); font-weight: 600; line-height: .98; letter-spacing: -.035em; }
.brand span { color: var(--mute); font-weight: 400; }
.form, .add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.form .cta { margin-top: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 99px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); margin-bottom: 4px; }
.seg button, .seg label { position: relative; display: grid; place-items: center; cursor: pointer; height: 42px; border-radius: 99px; color: var(--mute); font-weight: 500; transition: background .4s var(--ease), color .4s var(--ease); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg.grp { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.form[data-mode=login] .reg-only { display: none; }
.seg .on, .seg label:has(:checked) { background: rgba(255, 255, 255, .1); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.pw { position: relative; }
.pw input { padding-right: 56px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 20px; color: var(--mute); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.top-r { display: flex; gap: 8px; }
.bell { position: relative; }
.bell.on { background: rgba(255, 255, 255, .1); }
.bell b {
  position: absolute; top: -4px; right: -4px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--warn); color: var(--bg); font: 600 11px "Geist Mono", monospace;
}
.who { display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.who > span:last-child { display: grid; min-width: 0; }
.who b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small, .sh-head small { color: var(--mute); font-size: 12px; }
.av {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
  font: 500 13px "Geist Mono", monospace; color: var(--c, var(--ink));
  background: color-mix(in srgb, var(--c, #94a3b8) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 35%, transparent);
}
.av.lg { width: 58px; height: 58px; font-size: 17px; }

/* status */
.status::before {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 65%);
  pointer-events: none;
}
.st-main { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.st-ic {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; font-size: 28px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.st-l { font-size: clamp(24px, 8vw, 34px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; min-width: 0; }
.st-sub { margin-top: 14px; color: var(--mute); font-size: 14px; overflow-wrap: anywhere; }
.shell + .cta { margin-top: 12px; }

/* rows */
.list { display: grid; gap: 8px; }
.mt { margin-top: 14px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 12px;
  border-radius: 20px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .055);
  transition: transform .5s var(--ease), background .3s var(--ease);
}
.tap { cursor: pointer; }
.tap:hover { background: rgba(255, 255, 255, .05); }
.row > .ph-light { color: var(--mute); font-size: 16px; }
.tag {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px; font-size: 21px;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.row-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-t b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-t b i { color: #fbbf24; font-size: 14px; vertical-align: -1px; }
.row-t small { color: var(--c, var(--mute)); font-size: 13px; }
.row-t em { font-style: normal; color: var(--mute); font-size: 13px; overflow-wrap: anywhere; }

/* oggi */
.daybar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.day-l { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 4px 0; cursor: pointer; }
.day-l small { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.day-l small.now { color: var(--ok); }
.day-l span { font-size: 17px; font-weight: 500; }
.day-l span::first-letter { text-transform: uppercase; }
.day-l input { position: absolute; inset: 0; min-height: 0; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.bento { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; }
.kpi { min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; }
.num { font-size: 56px; font-weight: 600; letter-spacing: -.05em; line-height: 1; margin-top: 18px; }
.num small { font-size: 20px; color: var(--mute); font-weight: 400; letter-spacing: 0; }
.num.ok { color: var(--ok); }
.num.warn { color: var(--warn); }
.bar { height: 4px; margin-top: 16px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: var(--ok); box-shadow: 0 0 12px var(--ok); transform-origin: left; }
.anim .bar i { animation: grow 1.2s var(--ease) .3s both; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 99px; font-size: 13px;
  color: var(--c, var(--ink)); background: color-mix(in srgb, var(--c, #94a3b8) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 24%, transparent);
}
.chip i { font-size: 16px; }
.chip b { font: 500 12px "Geist Mono", monospace; color: var(--ink); }
.pres { margin-top: 26px; }
.pres summary {
  display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer;
  padding: 16px 18px; border-radius: 20px; background: rgba(52, 211, 153, .06); border: 1px solid rgba(52, 211, 153, .16);
  font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ok);
}
.pres summary::-webkit-details-marker { display: none; }
.pres summary b { font: 500 13px "Geist Mono", monospace; }
.names { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 2px; }
.names button { padding: 8px 12px; border-radius: 99px; background: var(--faint); border: 1px solid var(--line); font-size: 13px; }

/* personale */
.search { position: relative; }
.search i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: 18px; }
.search input { padding-left: 48px; border-radius: 99px; }

/* nav island */
#nav {
  position: fixed; z-index: 10; left: 50%; bottom: calc(var(--bot) + 14px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 99px;
  background: rgba(14, 16, 22, .72); border: 1px solid rgba(255, 255, 255, .09);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 48px -18px rgba(0, 0, 0, .7);
}
#nav button {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 99px;
  color: var(--mute); font-size: 14px; font-weight: 500;
  transition: background .5s var(--ease), color .5s var(--ease), transform .5s var(--ease);
}
#nav button i { font-size: 22px; }
#nav button:not(.on) span { display: none; }
#nav .on { background: rgba(255, 255, 255, .1); color: var(--ink); }
#nav .plus { width: 48px; padding: 0; justify-content: center; margin-left: 4px; background: var(--ink); color: var(--bg); }
#nav button:active { transform: scale(.94); }

/* sheet */
#sheet {
  width: 100%; max-width: 520px; max-height: 90dvh; margin: auto auto 0; padding: 0;
  border: 0; border-top: 1px solid rgba(255, 255, 255, .09); border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 120px), #0b0d12;
  color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
#sheet[open] { animation: sheetIn .5s var(--ease); }
#sheet.closing { animation: sheetOut .2s cubic-bezier(.4, 0, 1, 1) forwards; }
#sheet::backdrop { background: rgba(3, 4, 6, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.grab { padding: 12px 0 8px; cursor: pointer; }
.grab::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto; border-radius: 99px; background: rgba(255, 255, 255, .18); }
.sheet-body { padding: 4px 16px calc(var(--bot) + 24px); }
.sh-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 22px; }
.sh-head > div { display: grid; min-width: 0; }
.sh-head b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.grp-l { margin: 0 4px 10px; }
.grp-l + .seg { margin-bottom: 18px; }
.push-on { margin: -8px 0 22px; }
.push-hint { display: flex; align-items: flex-start; gap: 10px; margin: 0 4px 18px; color: var(--mute); font-size: 14px; line-height: 1.45; }
.push-hint i { flex: none; font-size: 18px; margin-top: 1px; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.tools button {
  display: grid; justify-items: center; gap: 8px; padding: 16px 6px; border-radius: 18px;
  background: var(--faint); border: 1px solid var(--line); font-size: 12px; color: var(--mute);
  transition: transform .5s var(--ease);
}
.tools button:active { transform: scale(.96); }
.tools i { font-size: 22px; color: var(--ink); }
.tools .on, .tools .on i { color: #fbbf24; }
.tools .danger i { color: var(--warn); }
.tools button { text-align: center; }

/* stato approvazione + richieste */
.st { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 500; color: #fbbf24; background: rgba(251, 191, 36, .12); }
.st.no { color: var(--warn); background: rgba(248, 113, 113, .12); }
.st.si { color: var(--ok); background: rgba(52, 211, 153, .12); }
.req { border-radius: 20px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .055); padding-bottom: 10px; }
.req .row { background: none; border: 0; }
.req-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 10px; }
.req-act .ghost { height: 46px; padding: 0 12px; }
.req-act .yes { color: var(--ok); border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .08); }
.empty { color: var(--mute); text-align: center; padding: 40px 0; }
.add h3 { margin: 2px 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.chi { border-radius: 20px; background: var(--faint); border: 1px solid var(--line); transition: border-color .3s var(--ease); }
.chi.open, .chi.set { border-color: rgba(96, 165, 250, .4); }
.chi-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 16px; font-size: 16px; text-align: left; }
.chi-btn > i { font-size: 20px; color: var(--mute); }
.chi-btn > i:last-child { font-size: 16px; transition: transform .5s var(--ease); }
.chi.open .chi-btn > i:last-child { transform: rotate(180deg); }
.chi-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mute); }
.chi.set .chi-l { color: var(--ink); }
.chi-n:not(:empty) { min-width: 26px; padding: 3px 8px; border-radius: 99px; background: var(--blue); color: var(--bg); font: 600 12px "Geist Mono", monospace; text-align: center; }
.chi-pane { display: none; padding: 0 8px 8px; }
.chi.open .chi-pane { display: grid; gap: 6px; animation: rise .5s var(--ease); }
.chi-pane .search input { min-height: 46px; }
.chi-list { display: grid; gap: 2px; max-height: 44dvh; overflow-y: auto; overscroll-behavior: contain; }
.chi-r { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 5px 12px 5px 6px; border-radius: 14px; cursor: pointer; }
.chi-r .av { width: 38px; height: 38px; font-size: 12px; }
.chi-r > span:nth-of-type(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chi-r > i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: transparent; font-size: 14px; transition: background .3s var(--ease), color .3s var(--ease); }
.chi-r:has(:checked) { background: rgba(96, 165, 250, .12); }
.chi-r:has(:checked) > i { background: var(--blue); border-color: var(--blue); color: var(--bg); }
.chi-r:has(:checked) .av { --c: var(--blue); }
.chi-r.all { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 14px 14px 4px 4px; }
.chi-r input, .tipo input { position: absolute; opacity: 0; pointer-events: none; }
.tipi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tipo {
  position: relative; display: grid; justify-items: center; gap: 8px; padding: 16px 4px 14px; border-radius: 18px; cursor: pointer;
  background: var(--faint); border: 1px solid var(--line); font-size: 12px; color: var(--mute); text-align: center;
  transition: background .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease);
}
.tipo i { font-size: 26px; color: var(--c); }
.tipo:active { transform: scale(.96); }
.tipo:has(:checked) { color: var(--ink); background: color-mix(in srgb, var(--c) 15%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.tipo:has(:focus-visible) { outline: 2px solid rgba(96, 165, 250, .7); }
.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dates label { display: grid; gap: 6px; }
.dates small { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); padding-left: 4px; }
.ore { display: none; }
.add:has([value=orario]:checked) .ore { display: grid; }
.add:has([value=orario]:checked) .d-al { display: none; }
.add:has([value=orario]:checked) .dates:not(.ore) { grid-template-columns: minmax(0, 1fr); }

/* licenza: sottotipo + luogo (solo con tipo licenza) */
.lic { display: none; }
.add:has([value=licenza]:checked) .lic { display: grid; gap: 8px; }
.lic .loc { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; }
select {
  display: block; width: 100%; min-width: 0; min-height: 52px; padding: 14px 46px 14px 18px;
  border-radius: 16px; border: 1px solid var(--line); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
  background: var(--faint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M56 96l72 72 72-72' fill='none' stroke='%23eef2f7' stroke-opacity='.52' stroke-width='18' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 18px center / 16px;
}
select:has(option[value=""]:checked) { color: rgba(238, 242, 247, .35); }
select:focus { border-color: rgba(96, 165, 250, .55); background-color: rgba(96, 165, 250, .05); }
option { background: #0b0d12; color: var(--ink); }
.cta.wide { margin-bottom: 14px; }

/* licenze (Aiutante Maggiore): card su mobile, tabella 16:9 su desktop */
.lic-h { display: none; }
.lic-r {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px 20px; padding: 14px 14px 14px 64px; position: relative;
  border-radius: 20px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .055);
  transition: opacity .3s var(--ease);
}
.lic-r.done { opacity: .5; }
.lic-r > span { min-width: 0; overflow-wrap: anywhere; display: grid; gap: 2px; align-content: start; }
.lic-r > span:empty { display: none; }
.lic-r > span:is([data-l=Dal], [data-l=Al]) { white-space: nowrap; overflow-wrap: normal; }
.lic-r > span::before { content: attr(data-l); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.lic-r > span:is([data-l=Nominativo], [data-l=Tipo], [data-l=Luogo], [data-l=Note], [data-l=Iter]) { grid-column: 1 / -1; }
.lic-r > span:is([data-l=Nominativo], [data-l=Iter])::before { display: none; }
.lic-r > span[data-l=Nominativo] b { font-size: 16px; }
.lic-r > span[data-l=Iter] { padding-top: 10px; border-top: 1px solid var(--line); }
.lic-r small { color: var(--mute); font-size: 12px; }
.chk {
  position: absolute; left: 8px; top: 8px; display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 16px; font-size: 26px; color: var(--mute); transition: transform .4s var(--ease), color .3s var(--ease);
}
.chk:active { transform: scale(.92); }
.chk[aria-pressed=true] { color: var(--ok); }
.lic-f { margin-bottom: 16px; }

@media (min-width: 900px) {
  #app.wide { max-width: 1280px; }
  #app.wide .lic-f { max-width: 460px; }
  .lic-h, .lic-r {
    display: grid; grid-template-columns: 48px minmax(150px, 1.3fr) 1fr 1.1fr 100px 100px 60px 110px 1.4fr 1.6fr;
    align-items: center; gap: 14px;
  }
  .lic-h {
    position: sticky; top: 0; z-index: 1; padding: calc(var(--top) + 10px) 12px 10px; background: var(--bg);
    border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
  }
  .lic-r { padding: 10px 12px; border-radius: 16px; }
  .lic-r:hover { background: rgba(255, 255, 255, .05); }
  .lic-r > span:is([data-l]) { grid-column: auto; }
  .lic-r > span::before { display: none; }
  .lic-r > span:empty { display: grid; }
  .lic-r > span:empty::after { content: "—"; color: var(--mute); }
  .lic-r > span[data-l=Iter] { padding-top: 0; border-top: 0; }
  .lic-r > span[data-l=Nominativo] b { font-size: inherit; }
  .chk { position: static; }
}

/* toast */
.toast {
  position: fixed; z-index: 20; left: 50%; bottom: calc(var(--bot) + 96px); max-width: calc(100% - 32px);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 99px; font-size: 14px; text-align: center;
  background: rgba(18, 20, 26, .88); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform .6s var(--ease), opacity .4s var(--ease);
}
#sheet .toast { bottom: auto; top: calc(var(--top) + 12px); transform: translate(-50%, -24px); }
.toast.show, #sheet .toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { color: #fecaca; border-color: rgba(248, 113, 113, .4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* cambio password (profilo) */
.pw-f { margin-bottom: 18px; }
.pw-f .grp-l { margin-bottom: 0; }

/* nullaosta: anteprima modificabile a schermo, A4 con 2 copie in stampa */
.na-btn { margin-bottom: 16px; }
#na { position: fixed; inset: 0; z-index: 50; overflow: auto; padding: 0 16px 40px; background: var(--bg); }
body:has(#na) { overflow: hidden; }
.na-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; max-width: 210mm; margin: 0 auto; padding: 16px 0; background: var(--bg); }
.na-bar > span { flex: 1; color: var(--mute); font-size: 14px; }
.na-page { max-width: 210mm; margin: 0 auto 24px; }
.na { padding: 10mm min(15mm, 5vw); border-radius: 4px; background: #fff; color: #000; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); font: 12pt/1.4 "Times New Roman", Times, serif; }
.na [data-k]:empty { display: inline-block; min-width: 10mm; min-height: 1em; } /* testo del modello svuotato: resta cliccabile */
.na + .na { display: none; }
.na p { margin: 0; }
.na-head { position: relative; margin-bottom: 6mm; text-align: center; }
.na-visto { position: absolute; left: 0; top: 0; font-size: 7pt; line-height: 1.6; }
@media screen and (max-width: 600px) { .na-visto { position: static; margin-bottom: 3mm; text-align: left; } }
.na .na-txt { margin-top: 4mm; line-height: 2; }
.na .f { display: inline-block; min-height: 1.3em; padding: 0 2mm; border-bottom: 1px solid; line-height: 1.3; text-align: center; outline: none; }
.na-cte { width: 52%; margin: 8mm 0 0 37%; text-align: center; }
.na-cdt { width: 45%; margin: 6mm 0 0 55%; text-align: center; white-space: nowrap; }
@media screen {
  .na [contenteditable]:hover { background: #f1f5f9; }
  .na [contenteditable]:focus { background: #fef3c7; outline: none; }
}
@media print {
  @page { size: A4; margin: 0; }
  body:has(#na) { overflow: visible; background: #fff; }
  body:has(#na) > :not(#na) { display: none !important; }
  #na { position: static; overflow: visible; padding: 0; background: none; }
  .na-bar { display: none; }
  .na-page { width: 210mm; max-width: none; margin: 0; }
  .na-page + .na-page { break-before: page; }
  .na { height: 148mm; overflow: hidden; padding: 10mm 15mm; border-radius: 0; box-shadow: none; }
  .na + .na { display: block; border-top: 1px solid #000; }
}
