/* Filo: moduli (voce 7a). Solo i token di style.css, così chiaro e scuro vengono da soli. */

/* messaggio del modulo (7o): stile da messaggio normale, niente riquadro; griglia a passi di 4 px */
.fcard { display: flex; flex-direction: column; gap: 8px; max-width: 680px; margin-top: 2px; }
.fc-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.fc-st { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; line-height: 20px; border-radius: 999px; padding: 0 8px; white-space: nowrap; border: 1px solid transparent; }
.fc-st.st-open { background: var(--mention-bg); color: var(--mention-text); }
.fc-st.st-in_progress { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.fc-st.st-resolved { background: transparent; color: var(--success); border-color: var(--success); }
.fc-asg { font-weight: 600; margin-left: 4px; }
/* il menu dello stato compare al passaggio sul messaggio (o con la tastiera); sui telefoni resta visibile */
.fc-set { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; opacity: 0; transition: opacity var(--t-fast, .12s); }
.fc-set .ic-svg { width: 14px; height: 14px; }
.fc-set:hover { color: var(--text); background: var(--bg-hover); }
.msg:hover .fc-set, .msg:focus-within .fc-set, .fc-set:focus-visible, .fc-set[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .fc-set { opacity: 1; } }
.fc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.fc-row { min-width: 0; }
.fc-row.wide, .fc-row.fc-by { grid-column: 1 / -1; }
.fc-row dt { font-weight: 700; font-size: 14px; line-height: 20px; color: var(--text); }
.fc-row dd { margin: 0; line-height: 20px; overflow-wrap: anywhere; }
.fc-files { display: inline-flex; align-items: center; gap: 4px; }
.fc-files .ic-svg { width: 14px; height: 14px; color: var(--muted); }
@media (max-width: 760px) { .fc-grid { grid-template-columns: 1fr; } }

/* galleria degli allegati del modulo: riquadri uguali, al massimo 4 per riga */
.fc-gal { width: 100%; max-width: 680px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fc-gal[data-n="1"] .fg-it { grid-column: span 2; }
.fg-it { position: relative; height: 176px; min-width: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); }
.fg-it .file-img { width: 100%; height: 100%; min-width: 0; max-width: none; max-height: none; object-fit: cover; border: 0; border-radius: 0; display: block; }
.fg-it .file-video { width: 100%; height: 100%; gap: 0; }
.fg-it .fv-box { height: 100%; border: 0; border-radius: 0; }
.fg-it .file-video:not(.started) video { object-fit: cover; }
.fg-it .fv-meta { display: none; }
.fg-it .fv-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
.fc-gal.fg-cut .fg-extra { display: none; }
/* video che il browser non sa riprodurre: la scheda file da scaricare riempie il riquadro */
.fg-it > .file-card { width: 100%; height: 100%; max-width: none; margin: 0; border: 0; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; }
.fg-it > .file-card > span { max-width: 100%; }
.fg-it > .file-card .fn { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fg-more { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 24px; font-weight: 700; cursor: pointer; }
.fg-more:hover { background: rgba(0, 0, 0, .65); }
.fg-more:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (max-width: 760px) { .fc-gal { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fg-it { height: 144px; } }

/* barra del modulo all'altezza del composer: pulsante pieno a sinistra, nota grigia, link alle richieste aperte */
.fm-cta { margin: 0 20px 8px; display: flex; align-items: center; gap: 12px; min-height: 40px; }
.fm-cta.fm-locked { margin-bottom: 16px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.fm-cta-btns { display: inline-flex; flex: none; }
.fm-cta-btns .btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; font-weight: 700; }
.fm-cta-btns .ic-svg { width: 14px; height: 14px; }
.fm-cta-btns .fm-cta-main:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fm-cta-btns .fm-cta-more { padding: 0 8px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent); }
.fm-cta-note { margin: 0; flex: 1; min-width: 0; color: var(--muted); font-size: 13px; line-height: 20px; }
.fm-help { color: var(--accent-strong); }
.fm-req-link { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.fm-req-link:hover { background: var(--bg-hover); color: var(--text); }
.fm-req-link .ic-svg { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .fm-cta { margin: 0 12px 8px; flex-wrap: wrap; gap: 8px; }
  .fm-cta-btns { flex: 1 0 100%; }
  .fm-cta-btns .fm-cta-main { flex: 1; justify-content: center; }
  .fm-cta-note { flex: 1; }
}

/* compilazione */
.fm-modal { max-width: 560px; }
.fm-modal .modal-head h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.fm-ic { font-size: 20px; }
.fm-body { gap: 14px; }
.fm-desc { color: var(--muted); font-size: 14px; }
.fm-step { display: flex; flex-direction: column; gap: 14px; }
.fm-step[hidden] { display: none; }
.fm-step-title { margin: 0; font-size: 16px; }
.ff { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.ff-label { font-weight: 700; font-size: 14px; padding: 0; }
.ff-opt { font-weight: 400; color: var(--muted); }
.ff input:not([type=checkbox]):not([type=radio]):not([type=file]), .ff textarea, .ff select { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; width: 100%; }
.ff textarea { resize: vertical; min-height: 84px; }
.ff input:focus-visible, .ff textarea:focus-visible, .ff select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ff.bad input, .ff.bad textarea, .ff.bad select { border-color: var(--danger); }
.ff-err { color: var(--danger); font-size: 13px; margin: 0; min-height: 0; }
.ff-err:empty { display: none; }
.ff-help { color: var(--muted); font-size: 13px; background: var(--bg-soft); border-radius: 6px; padding: 6px 9px; }
.ff-checks { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ff-checks.ff-row { flex-direction: row; gap: 18px; }
.ff-checks label { display: inline-flex; align-items: center; gap: 6px; }
.ff-files { display: flex; flex-direction: column; gap: 6px; }
.ff-file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-progress { position: fixed; right: 16px; bottom: 16px; z-index: 60; background: var(--top-bg); color: var(--side-strong); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.fm-ok { text-align: center; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fm-ok h3 { margin: 0; }
.fm-ok-ic { color: var(--success); }
.fm-filter { display: flex; gap: 6px; }
.fm-filter .chip { border: 1px solid var(--border); background: var(--bg); }
.fm-filter .chip.on { background: var(--accent-soft); border-color: var(--accent); }
.fm-req .fc-st { flex: none; }

/* gestione */
.fm-tpl { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-tpl .btn { display: inline-flex; align-items: center; gap: 6px; }
.fe-modal { max-width: 1120px; max-height: 92vh; }
.fe-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fe-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fe-sec { display: flex; flex-direction: column; gap: 10px; }
.fe-sec h3 { margin: 0; font-size: 15px; }
.fe-line { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fe-line .grow { flex: 1; min-width: 180px; }
.fe-icon { font-size: 20px; width: 44px; height: 40px; padding: 0; }
.fe-cmd { display: flex; align-items: center; gap: 2px; font-weight: 700; }
.fe-cmd input { width: 140px; }
.fe-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fe-people input[type=search] { padding: 7px 10px; }
.fe-plist { max-height: 140px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.fe-plist label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.fe-plist label[hidden] { display: none; }
.fe-fields { display: flex; flex-direction: column; gap: 8px; }
.fe-field { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 6px; }
.fe-field.dragging { opacity: .5; }
.fe-field.drop-here { border-color: var(--accent); box-shadow: 0 -3px 0 var(--accent); }
.fe-fhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fe-fhead select, .fe-fhead input[data-f=label] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); }
.fe-fhead input[data-f=label] { flex: 1; min-width: 140px; }
.fe-grip { cursor: grab; color: var(--muted); letter-spacing: -2px; user-select: none; padding: 0 2px; }
.fe-req { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.fe-field .field { font-size: 13px; }
.fe-add { display: flex; gap: 8px; }
.fe-add select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.fe-preview { position: sticky; top: 0; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.fe-pv-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.fe-pv-head { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 8px; }
.fe-pv-body { display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.fe-pv-body .fm-step + .fm-step { border-top: 1px dashed var(--border); padding-top: 10px; }
.fe-secret { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); color: var(--text); }
@media (max-width: 860px) { .fe-wrap, .fe-two { grid-template-columns: 1fr; } .fe-preview { position: static; } }
