/* ==========================================================================
   Spindle — Calendario. Usa i token di style.css.
   ========================================================================== */
.cal { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); background: var(--canvas); }
.cal > .adm-loading, .cal > .empty { grid-column: 1 / -1; margin: auto; }
.cal__side { min-height: 0; overflow-y: auto; padding: 14px 12px 20px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 16px; }
.cal__sidehead { display: none; }
.cal__scrim { display: none; }
.cal__main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cal__head { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; min-height: var(--topbar-h); border-bottom: 1px solid var(--line); background: var(--surface); }
.cal__head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--hairline-gradient); opacity: .5; }
.cal__sidebtn { display: none; }
.cal__nav { display: flex; gap: 2px; }
.cal__title { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__title::first-letter { text-transform: uppercase; }
.cal__viewbtn { gap: 4px; padding-right: 8px; }
.cal__viewbtn .i { width: 15px; height: 15px; }
.cal__today { border-radius: 999px; padding: 0 16px; }
.cal__search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 640px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--sunken); }
.cal__search .i { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.cal__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.cal__hint { padding: 10px 20px 0; font-size: 12.5px; color: var(--ink-3); }
/* Su schermi larghi si crea dal pulsante «Crea» della colonna (come Google); il pulsante in alto serve quando la
   colonna è chiusa in un cassetto. */
@media (min-width: 1100px) { .cal__newbtn { display: none; } }
.cal__note { display: flex; align-items: center; gap: 6px; padding: 6px 20px; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); }
.cal__note .i { width: 14px; height: 14px; }
.cal__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* «Crea» in stile Google: pillola chiara con ombra, in cima alla colonna */
.cal__create { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px 0 16px; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 650; box-shadow: 0 1px 3px rgba(10, 4, 30, .18), 0 4px 10px -2px rgba(10, 4, 30, .14); transition: box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.cal__create .i { width: 22px; height: 22px; color: var(--accent); }
.cal__create:hover { box-shadow: 0 2px 6px rgba(10, 4, 30, .22), 0 8px 18px -4px rgba(10, 4, 30, .2); background: var(--surface-2); }
[data-theme="dark"] .cal__create { background: var(--surface-2); }
.calpeople__search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 10px; background: var(--sunken); }
.calpeople__search .i { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.calpeople__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); outline: none; }
.calpeople__search:focus-within { box-shadow: var(--focus); }
.calpeople__res { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); }
.calpeople__res[hidden] { display: none; }
.calpeople__row { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: var(--ink); }
.calpeople__row:hover, .calpeople__row:focus-visible { background: var(--sunken); }
.calpeople__face { width: 28px; height: 28px; font-size: 10.5px; flex: none; }
.calpeople__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.calpeople__txt strong { font-size: 13px; font-weight: 600; }
.calpeople__txt small { font-size: 11.5px; color: var(--ink-3); }
.calpeople__none { padding: 6px; font-size: 12.5px; color: var(--ink-3); }
.calsec__note { padding: 0 6px; font-size: 11.5px; color: var(--ink-3); }

/* Mini mese */
.mini__head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.mini__head strong { flex: 1; font-size: 13.5px; font-weight: 680; padding-left: 4px; }
.mini__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini__w { text-align: center; font-size: 10.5px; font-weight: 650; color: var(--ink-3); padding: 2px 0 4px; }
.mini__d { height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini__d:hover { background: var(--sunken); }
.mini__d.is-out { color: var(--ink-4); }
.mini__d.is-range { background: var(--accent-soft); color: var(--accent-ink); border-radius: 0; }
.mini__d.is-today { background: var(--accent-solid); color: #fff; border-radius: 50%; font-weight: 700; }

/* Sezioni della barra */
.calsec { display: flex; flex-direction: column; gap: 4px; }
.calsec__title { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.calsec__title .i { width: 14px; height: 14px; }
.calsec__title .sb-count { margin-left: auto; }
.calsec__empty { padding: 2px 6px; font-size: 12.5px; color: var(--ink-3); list-style: none; }
.calsec__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; }
.calrows { list-style: none; margin: 0; padding: 0; }
.calrow { position: relative; display: flex; align-items: center; border-radius: 8px; }
.calrow:hover { background: var(--sunken); }
.calrow__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 6px 6px; cursor: pointer; }
.calrow__main input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.calrow__box { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--cc); color: #fff; }
.calrow__box .i { width: 12px; height: 12px; opacity: 0; }
.calrow__main input:checked + .calrow__box { background: var(--cc); }
.calrow__main input:checked + .calrow__box .i { opacity: 1; }
.calrow__main input:focus-visible + .calrow__box { box-shadow: var(--focus); }
.calrow__name { min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; overflow: hidden; }
.calrow__name small { font-size: 11px; color: var(--ink-3); }
.calrow__more { position: static; opacity: 0; }
.calrow:hover .calrow__more, .calrow__more:focus-visible, .calrow__more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .calrow__more { opacity: 1; } }
.calinv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.calinv__item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; padding: 7px 9px; border: 1px dashed var(--accent); border-radius: 9px; background: var(--accent-soft); text-align: left; color: var(--ink); }
.calinv__item strong { font-size: 13px; font-weight: 620; }
.calinv__item small { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }

/* ---------- Settimana / giorno ---------- */
.cwk { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.cwk__top, .cwk__allday { display: grid; grid-template-columns: 56px repeat(var(--days, 7), minmax(0, 1fr)); }
.cwk__sticky { position: sticky; top: 0; z-index: 6; background: var(--surface); }
.cwk__top { border-bottom: 1px solid var(--line); }
.cwk__gut--tz { display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 6px 6px; font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cwk__dh--cal { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 8px 6px; border-bottom: 3px solid var(--cc); }
.cwk__face { width: 28px; height: 28px; font-size: 10.5px; flex: none; }
.cwk__caldot { width: 12px; height: 12px; border-radius: 4px; background: var(--cc); flex: none; }
.cwk__who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.cwk__who strong { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cwk__who small { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Fuori dall'orario di lavoro e nel fine settimana: fascia più scura, come Google. */
.cwk__off { position: absolute; left: 0; right: 0; z-index: 0; background: color-mix(in srgb, var(--ink) 3.5%, transparent); pointer-events: none; }
[data-theme="dark"] .cwk__off { background: rgba(0, 0, 0, .18); }
.cwk__gut { border-right: 1px solid var(--line); }
.cwk__gut--ad { display: flex; align-items: center; justify-content: flex-end; padding: 0 6px; font-size: 10px; color: var(--ink-3); text-align: right; line-height: 1.1; }
.cwk__dh { padding: 6px 4px; text-align: center; border-right: 1px solid var(--line); }
.cwk__dbtn { display: inline-flex; flex-direction: column; align-items: center; gap: 0; padding: 2px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); }
.cwk__dbtn:hover { background: var(--sunken); }
.cwk__dw { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cwk__dn { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.cwk__dn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; font-weight: 500; }
.cwk__dbtn:hover .cwk__dn { background: var(--sunken); }
.cwk__dbtn:hover { background: transparent; }
.cwk__dh.is-today .cwk__dn { background: var(--accent-solid); color: #fff; }
.cwk__dh.is-today .cwk__dw { color: var(--accent-ink); }
.cwk__allday { border-bottom: 1px solid var(--line-strong); max-height: 110px; overflow-y: auto; }
.cwk__ad { display: flex; flex-direction: column; gap: 2px; min-height: 28px; padding: 3px 3px; border-right: 1px solid var(--line); cursor: pointer; }
.cwk__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cwk--people .cwk__col { min-width: 0; }
.cwk__grid { position: relative; display: grid; grid-template-columns: 56px repeat(var(--days, 7), minmax(0, 1fr)); }
.cwk__hours { grid-row: 1; grid-column: 1; border-right: 1px solid var(--line); }
.cwk__hr { position: relative; height: 48px; }
.cwk__hr span { position: absolute; top: -7px; right: 8px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cwk__col {
  position: relative; grid-row: 1; border-right: 1px solid var(--line); cursor: cell; touch-action: pan-y;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px);
  background-size: 100% 48px, 100% 24px; background-position: 0 0, 0 0;
}
.cwk__col.is-today { background-color: transparent; }
.cwk__now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cwk__now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cwk--people .cwk__col:not(:nth-child(2)) .cwk__now::before { display: none; }   /* un solo pallino, sulla prima colonna */

.evb {
  position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0; overflow: hidden; padding: 3px 7px;
  border: 0; border-radius: 6px; background: var(--ev); color: #fff; text-align: left;
  box-shadow: 0 0 0 1px var(--surface); cursor: pointer;
}
.evb:hover { box-shadow: 0 0 0 1px var(--surface), 0 4px 10px -3px rgba(10, 4, 30, .35); z-index: 20 !important; }
.evb:focus-visible { box-shadow: var(--focus); z-index: 20 !important; }
.evb__title { display: flex; align-items: center; gap: 3px; max-width: 100%; font-size: 12px; font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evb__title .i { width: 11px; height: 11px; flex: none; opacity: .85; }
.evb__time { max-width: 100%; font-size: 11px; color: rgba(255, 255, 255, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.evb--short { flex-direction: row; align-items: center; gap: 6px; padding-top: 1px; padding-bottom: 1px; }
.evb--short .evb__title { flex: 0 1 auto; min-width: 40px; }
.evb--short .evb__time { flex: 0 100 auto; min-width: 0; }   /* nello spazio stretto si accorcia prima l'ora del titolo */
.evb.is-past { opacity: .6; }
.evb--busy { background: repeating-linear-gradient(135deg, var(--sunken), var(--sunken) 6px, var(--surface-2) 6px, var(--surface-2) 12px); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 1px var(--surface); }
.evb--busy .evb__time { color: var(--ink-3); }
.evb.is-pending { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ev), 0 0 0 1px var(--surface); }
.evb.is-pending .evb__time, .evb.is-declined .evb__time { color: var(--ink-2); }
.evb.is-declined { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ev); text-decoration: line-through; }
.evb.is-tentative { background: repeating-linear-gradient(135deg, var(--ev), var(--ev) 6px, color-mix(in srgb, var(--ev) 72%, var(--surface)) 6px, color-mix(in srgb, var(--ev) 72%, var(--surface)) 12px); }
.evb__resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.evb__resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 16px; height: 2px; margin-left: -8px; border-radius: 2px; background: rgba(255, 255, 255, .7); opacity: 0; }
.evb:hover .evb__resize::after { opacity: 1; }
body.is-resizing-event, body.is-resizing-event * { cursor: ns-resize !important; user-select: none; }
.evghost { position: absolute; left: 2px; right: 4px; z-index: 30; padding: 3px 7px; border-radius: 6px; background: var(--accent-solid); color: #fff; font-size: 11.5px; font-weight: 650; pointer-events: none; opacity: .9; font-variant-numeric: tabular-nums; overflow: hidden; }
.evghost--draft { opacity: 1; box-shadow: 0 6px 16px -4px rgba(10, 4, 30, .45); }

.evchip {
  display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; height: 22px; padding: 0 6px; border: 0; border-radius: 5px;
  background: var(--ev); color: #fff; font-size: 11.5px; font-weight: 600; text-align: left; cursor: pointer;
}
.evchip:hover { filter: brightness(1.06); }
.evchip .i { width: 12px; height: 12px; flex: none; }
.evchip__t { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.evchip__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nel mese gli eventi a orario sono pallino + ora + titolo su fondo trasparente (Google); la giornata intera è piena. */
.evchip--timed { background: transparent; color: var(--ink); }
.evchip--timed:hover { background: var(--sunken); filter: none; }
.evchip--timed .evchip__t { color: var(--ink-2); }
.evchip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ev); flex: none; }
.evchip--task { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ev); }
.evchip--task .i { color: var(--ev); }
.evchip--ms { background: color-mix(in srgb, var(--ev) 16%, var(--surface)); color: var(--ink); box-shadow: inset 3px 0 0 var(--ev); }
.evchip--ms .i { color: var(--ev); }
.evchip--busy { background: var(--sunken); color: var(--ink-3); }
.evchip.is-past { opacity: .6; }
.evchip.is-pending { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ev); }
.evchip.is-declined { background: transparent; color: var(--ink-3); text-decoration: line-through; }
.evchip.is-tentative:not(.evchip--timed) { background: repeating-linear-gradient(135deg, var(--ev), var(--ev) 6px, color-mix(in srgb, var(--ev) 72%, var(--surface)) 6px, color-mix(in srgb, var(--ev) 72%, var(--surface)) 12px); }

/* ---------- Mese ---------- */
.cmo { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.cmo__head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cmo__head span { padding: 6px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); text-align: center; border-right: 1px solid var(--line); }
.cmo__grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.cmo__cell { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; cursor: cell; }
.cmo__cell.is-out { background: var(--surface-2); }
.cmo__cell.is-out .cmo__num { color: var(--ink-4); }
.cmo__num { align-self: center; min-width: 24px; height: 24px; padding: 0 6px; border: 0; border-radius: 12px; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cmo__num:hover { background: var(--sunken); }
.cmo__cell.is-today .cmo__num { background: var(--accent-solid); color: #fff; }
.cmo__list { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.cmo__more { align-self: flex-start; padding: 0 6px; height: 20px; border: 0; border-radius: 5px; background: transparent; font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.cmo__more:hover { background: var(--sunken); color: var(--ink); }

/* ---------- Popover dell'evento ---------- */
.pop--event { width: min(380px, calc(100vw - 16px)); padding: 0; }
.evpop { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; }
.evpop__head { display: flex; align-items: flex-start; gap: 10px; }
.evpop__dot { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 4px; background: var(--ev); }
.evpop__titles { flex: 1; min-width: 0; }
.evpop__title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; overflow-wrap: anywhere; }
.evpop__when { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.evpop__when::first-letter { text-transform: uppercase; }
.evpop__line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.evpop__line .i { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--ink-3); }
.evpop__titles .evpop__line { margin-top: 4px; }
.evpop__desc { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow-y: auto; }
.evpop__att { display: flex; flex-direction: column; gap: 4px; }
.evpop__attl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.evpop__attl .i { width: 15px; height: 15px; color: var(--ink-3); }
.evpop__att ul { list-style: none; margin: 0; padding: 0 0 0 23px; display: flex; flex-direction: column; gap: 3px; }
.evpop__att li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.evpop__att li > span:not(.face) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evpop__face { flex: none; width: 22px; height: 22px; font-size: 9px; }
.resp { font-size: 11.5px; color: var(--ink-3); }
.resp--accepted { color: var(--ok); }
.resp--declined { color: var(--danger-ink); }
.resp--tentative { color: var(--warn); }
.evpop__rsvp { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.evpop__rsvp > span { margin-right: auto; }
.rsvp { height: 30px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
.rsvp:hover { border-color: var(--accent); }
.rsvp.is-on.rsvp--accepted { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.rsvp.is-on.rsvp--tentative { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.rsvp.is-on.rsvp--declined { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-ink); }
.evpop__foot { display: flex; justify-content: flex-end; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.evpop__foot .btn:first-child { margin-right: auto; }
.pop--colors { padding: 8px 12px 10px; }
.cal-swatches { padding: 6px 2px; }
.pop__note { font-size: 11.5px; color: var(--ink-3); }

/* ---------- Editor dell'evento ---------- */
.modal__card--event { max-width: 720px; }
.evf { display: flex; flex-direction: column; gap: 12px; }
.evf__title { height: 46px; font-size: 18px; font-weight: 650; }
.evf__row { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 12px; }
.evf__row--top { align-items: start; }
.evf__row--top > .i { margin-top: 10px; }
.evf__row > .i { width: 18px; height: 18px; color: var(--ink-3); }
.evf__dates, .evf__rec, .evf__inline, .evf__recend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.evf__dates .input[type="date"] { width: 150px; }
.evf__time { width: 124px; }
.evf__num { width: 80px; }
.evf__dash { color: var(--ink-3); }
.evf__recend[hidden], .evf__dates [hidden], .evf__recend [hidden] { display: none; }
.evf__rec .select { width: auto; max-width: 100%; }
.evf__inline .select { width: auto; }
.evf__inline .chk span { display: inline-flex; align-items: center; gap: 4px; }
.evf__inline .chk .i { width: 13px; height: 13px; }
.evf__att { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.evf__chips { position: relative; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); }
.evf__chips:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.evf__atthelp { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.evf__mbx[hidden] { display: none; }
.evf__rem { display: flex; flex-wrap: wrap; gap: 6px; }
.evf__remopt { position: relative; cursor: pointer; }
.evf__remopt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.evf__remopt.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.evf__remopt:has(input:focus-visible) { box-shadow: var(--focus); }
.evf__err[hidden] { display: none; }
.evf__errbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger-ink); font-size: 13px; }
.evf__errbox > span { flex: 1; min-width: 200px; }
.evf__errbox > .i { width: 18px; height: 18px; flex: none; }
.evf__find { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.evf__find[hidden] { display: none; }
.find__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.find__head small { color: var(--ink-3); font-size: 12px; }
.find__warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--warn); }
.find__warn .i { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.find__slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.find__slot { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); text-align: left; font-size: 12.5px; color: var(--ink); }
.find__slot strong { text-transform: capitalize; font-weight: 650; }
.find__slot span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.find__slot:hover { border-color: var(--accent); }
.find__slot.is-on { border-color: var(--accent); background: var(--accent-soft); }
.scope { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Dialoghi: elenco calendari, condivisione, link ---------- */
.dir__h { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.dirlist, .shlist, .feedlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dirrow, .shrow, .feedrow { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; }
.dirrow[hidden] { display: none; }
.dirrow:hover, .shrow:hover { background: var(--surface-2); }
.dirrow__face { width: 30px; height: 30px; font-size: 11px; flex: none; }
.mini__head strong::first-letter { text-transform: uppercase; }
.dirrow__dot { width: 14px; height: 14px; border-radius: 4px; background: var(--cc); flex: none; margin: 0 8px; }
.dirrow__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dirrow__text strong { font-size: 13.5px; font-weight: 600; }
.dirrow__text small { font-size: 12px; color: var(--ink-3); }
.shrow strong { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.shrow .select { width: auto; }
.shadd { margin-top: 6px; }
.feed-make { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.feednew { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); margin: 10px 0; }
.feednew > strong { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); }
.feednew > strong .i { width: 16px; height: 16px; }
.feednew .oapp__uri { width: 100%; }
.feedrow > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; font-size: 13px; }
.feedrow small { font-size: 12px; color: var(--ink-3); }
.feedrow__act { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.feedrow__confirm { font-size: 12px; color: var(--danger-ink); }

.toast--reminder { align-items: center; border-left: 3px solid var(--accent); }
.toast--reminder .toast__msg { display: flex; flex-direction: column; line-height: 1.35; }
.toast--reminder small { font-size: 12px; color: var(--ink-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal__side { position: fixed; top: 0; bottom: 0; left: var(--rail-w); z-index: 60; width: min(300px, calc(100vw - var(--rail-w) - 24px)); transform: translateX(calc(-100% - var(--rail-w))); visibility: hidden; transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med); }
  .cal--side-open .cal__side { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform var(--t-med) var(--ease), visibility 0s; }
  .cal__scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease); }
  .cal--side-open .cal__scrim { opacity: 1; pointer-events: auto; }
  .cal__sidehead { display: flex; justify-content: flex-end; margin-bottom: -8px; }
  .cal__sidebtn { display: inline-grid; margin-left: -6px; }
}
@media (max-width: 699px) {
  .cal__side { left: 0; bottom: var(--tabbar-h); width: min(304px, 86vw); }
  .cal__head { padding: max(8px, env(safe-area-inset-top)) 12px 8px; gap: 6px; }
  .cal__title { order: 10; flex-basis: 100%; font-size: 16px; }
  .cal__viewbtn { margin-left: auto; }
  .cwk__gut--tz { font-size: 9px; padding: 0 3px 6px; }
  .cal__newbtn { position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 16px); z-index: 30; height: 48px; padding: 0 18px; border-radius: 24px; box-shadow: var(--shadow-md); }
  .cwk__top, .cwk__allday, .cwk__grid { grid-template-columns: 44px repeat(var(--days, 7), minmax(0, 1fr)); }
  .cwk__hr span { right: 4px; font-size: 10px; }
  .cwk__dbtn { padding: 2px 4px; }
  .cwk--dense .cwk__dn { font-size: 15px; width: 30px; height: 30px; }
  .cwk--dense .evb__time { display: none; }
  .cwk--dense .evb { padding: 2px 3px; }
  .cwk--dense .evb__title { font-size: 10.5px; white-space: normal; }
  .cwk--dense .evb--short .evb__title { white-space: nowrap; }
  .cmo__cell { padding: 2px; }
  .cmo .evchip { height: 18px; padding: 0 3px; font-size: 10px; border-left-width: 2px; }
  .cmo .evchip__t, .cmo .evchip .i { display: none; }
  .cmo__num { min-width: 22px; height: 22px; font-size: 11.5px; padding: 0 4px; }
  .cmo__more { font-size: 10px; padding: 0 3px; }
  .evf__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .evf__row > .i { display: none; }
  .evf__dates .input[type="date"] { width: calc(50% - 4px); flex: 1 1 140px; }
  .evf__time { flex: 1 1 90px; }
  .evf__dash { display: none; }
}

/* Spostamento trascinando: la scheda originale resta come traccia, l'anteprima ha il colore dell'evento. */
.evb--draggable { cursor: grab; }
body.is-dragging-event, body.is-dragging-event * { cursor: grabbing !important; user-select: none; }
.evb.is-moving { opacity: .35; }
.evghost--move { background: var(--ev, var(--accent-solid)); box-shadow: 0 6px 16px -6px rgba(10, 4, 30, .45); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Anno ---------- */
.cyr { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 32px; padding: 20px 24px 32px; background: var(--surface); align-content: start; }
.cyr__t { margin: 0 0 6px 6px; font-size: 14px; font-weight: 650; }
.cyr__t::first-letter { text-transform: uppercase; }
.cyr__g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cyr__w { text-align: center; font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding-bottom: 4px; }
.cyr__d { position: relative; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 11.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cyr__d:hover { background: var(--sunken); }
.cyr__d.is-today { background: var(--accent-solid); color: #fff; font-weight: 700; }
.cyr__d.has-ev::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cyr__d.is-today.has-ev::after { background: #fff; }

/* ---------- Pianificazione (agenda) e risultati di ricerca ---------- */
.cag { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 8px 20px 32px; background: var(--surface); }
.cag--empty { display: grid; place-items: center; }
.cag__day { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cag__date { align-self: start; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); text-align: left; }
.cag__date:hover { background: var(--sunken); }
.cag__dn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cag__dw { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); line-height: 1.2; }
.cag__day.is-today .cag__dn { background: var(--accent-solid); color: #fff; }
.cag__day.is-today .cag__dw { color: var(--accent-ink); }
.cag__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cag__item { width: 100%; display: grid; grid-template-columns: 12px 140px minmax(0, 1fr); align-items: center; gap: 12px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.cag__item:hover { background: var(--sunken); }
.cag__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ev); }
.cag__when { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cag__what { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cag__what strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cag__what small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cag__item.is-past { opacity: .6; }
.cag__item.is-declined strong { text-decoration: line-through; }
.cag__item.is-pending .cag__dot { background: transparent; box-shadow: inset 0 0 0 2px var(--ev); }

/* ---------- Creazione rapida ---------- */
.pop--quick { width: min(380px, calc(100vw - 16px)); padding: 0; }
.qc { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 12px; }
.qc__title { width: 100%; height: 40px; padding: 0 2px; border: 0; border-bottom: 2px solid var(--line-strong); background: transparent; font: inherit; font-size: 19px; font-weight: 600; color: var(--ink); outline: none; }
.qc__title:focus, .qc__title:focus-visible { border-bottom-color: var(--accent); box-shadow: none; outline: none; }
.qc__line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.qc__line::first-letter { text-transform: uppercase; }
.qc__line .i { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.qc__line .select { width: auto; max-width: 100%; }
.qc__err { font-size: 12.5px; color: var(--danger-ink); }
.qc__err[hidden] { display: none; }
.qc__foot { display: flex; justify-content: flex-end; gap: 6px; padding-top: 4px; }

/* ---------- Disponibilità degli invitati nell'editor ---------- */
.evf__avail { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.evf__avail[hidden] { display: none; }
.av__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; font-size: 13px; }
.av__head small { font-size: 12px; color: var(--ink-3); }
.av__row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 30px; }
.av__who { min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.av__who > span:not(.face):not(.av__warn) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av__face { width: 22px; height: 22px; font-size: 9px; flex: none; }
.av__warn .i { width: 14px; height: 14px; color: var(--warn); }
.av__track { position: relative; height: 24px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; overflow: hidden; }
.av__busy { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 38%, var(--surface)); }
.av__band { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 2px var(--accent); pointer-events: none; }
.av__row.is-unknown .av__track { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 6px, var(--sunken) 6px, var(--sunken) 12px); cursor: default; }
.av__unk { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--ink-3); }
.av__row--ticks { min-height: 14px; }
.av__ticks { position: relative; height: 14px; }
.av__ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 699px) {
  .av__row { grid-template-columns: 90px minmax(0, 1fr); }
  .cag { padding: 4px 12px 96px; }
  .cag__day { grid-template-columns: 60px minmax(0, 1fr); gap: 6px; }
  .cag__date { flex-direction: column; gap: 0; }
  .cag__item { grid-template-columns: 10px minmax(0, 1fr); }
  .cag__when { grid-column: 2; }
  .cag__what { grid-column: 2; }
  .cyr { padding: 12px 12px 96px; gap: 16px; }
  .cal__create { display: none; }
}

/* Selezione su più giorni: bozza a pezzi nella griglia oraria e celle evidenziate (riga «tutto il giorno», mese). */
.evghost--multi { border-radius: 4px; }
.cwk__ad.is-selecting, .cmo__cell.is-selecting { background: color-mix(in srgb, var(--accent-solid) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-solid) 45%, transparent); }
.cwk__ad, .cmo__cell { user-select: none; }
