/* Rubik, servito dal nostro server (licenza OFL) */
@font-face {
  font-family: "Rubik"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/rubik-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Rubik"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/rubik-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* palette ufficiale santorografica.com e dal marchio */
  --lime: #BBCD02;
  --lime-hover: #a8b900;
  --lime-soft: #f3f8c4;
  --lime-text: #6c7800;
  --magenta: #E6007E;
  --magenta-soft: #ffe3f1;
  --cyan: #009FE3;
  --yellow: #FFED00;
  --ink: #282828;
  --ink-deep: #1D1D1B;
  --text: #494949;
  --muted: #7d7d7d;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --line: #e2e2e2;
  --danger: #c4161c;
  --ok: #12a150;
  --bubble-in: #ffffff;
  --bubble-out: #e9f2a6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.08);
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
h1, h2, h3, strong { color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* bottoni */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 14px; font-weight: 500; }
.btn:hover { background: #f6f6f6; }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: transparent; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(0,0,0,.07); }

/* login: come il sito, con la barra laterale lime */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 24px 24px 86px; background: #fff; position: relative; }
.login-rail { position: fixed; inset: 0 auto 0 0; width: 62px; background: var(--lime); display: grid; place-items: center; }
.login-rail span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--ink); white-space: nowrap; }
.login-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px; display: grid; gap: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.08); }
.login-card h1 { margin: 6px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.login-card p { margin: 0; }
.login-logo { width: 210px; max-width: 100%; height: auto; margin-bottom: 4px; }
.login-card label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink); }
.login-card input, .modal input, .modal select, .modal textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; width: 100%; }
.login-card input:focus, .modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--lime); outline: 2px solid var(--lime-soft); }
.error { color: var(--danger); min-height: 1.2em; font-size: 13px; }

/* layout app */
.app { height: 100%; display: grid; grid-template-columns: 390px 1fr; background: var(--panel); }
.sidebar { border-right: 1px solid var(--line); border-left: 10px solid var(--lime); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.side-head { background: #fff; padding: 12px 12px 10px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.brand-text { display: grid; gap: 5px; flex: 1; min-width: 0; }
.brand-logo { height: 34px; width: auto; max-width: 100%; justify-self: start; display: block; }
.pill { font-size: 11.5px; font-weight: 500; cursor: pointer; color: var(--muted); }
.pill::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--magenta); }
.pill.on::before { background: var(--ok); }
.pill.off { color: var(--magenta); }
.pill.on { color: #0d7a3d; }
.side-head .icon-btn { color: var(--ink); font-size: 24px; font-weight: 300; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--lime); color: var(--ink); font-weight: 600; }
.avatar-btn:hover { background: var(--lime-hover); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 46px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.16); min-width: 250px; z-index: 30; overflow: hidden; }
.menu button { display: block; width: 100%; text-align: left; padding: 11px 14px; border: 0; background: #fff; color: var(--text); }
.menu button:hover { background: var(--bg); }
.menu-user { padding: 12px 14px; display: grid; border-bottom: 1px solid var(--line); }
.search-box { padding: 10px 12px 6px; }
.search-box input { width: 100%; border: 1px solid transparent; background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.search-box input:focus { border-color: var(--lime); background: #fff; outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 10px; }
.filters button { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 11px; font-size: 13px; white-space: nowrap; }
.filters button:hover { border-color: var(--ink); }
.filters button.active { background: var(--ink); color: var(--lime); border-color: var(--ink); font-weight: 500; }
.chat-list { flex: 1; overflow-y: auto; min-height: 0; }
.list-section { padding: 8px 14px 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chat-item { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f0f0f0; cursor: pointer; align-items: center; border-left: 4px solid transparent; }
.chat-item:hover { background: #fafafa; }
.chat-item.active { background: var(--lime-soft); border-left-color: var(--lime); }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .name { font-weight: 500; color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .time { font-size: 12px; color: var(--muted); flex: none; }
.row .time.unread { color: var(--magenta); font-weight: 600; }
.preview { color: var(--muted); font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: var(--magenta); color: #fff; border-radius: 999px; min-width: 21px; height: 21px; padding: 0 6px; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; flex: none; }
.chip { font-size: 11px; font-weight: 500; background: #eeeeee; color: #555; border-radius: 999px; padding: 2px 8px; flex: none; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.me { background: var(--lime-soft); color: var(--lime-text); font-weight: 600; }
.chip.free { background: var(--magenta-soft); color: #a8005c; }
.chip.wait { font-weight: 600; max-width: none; }
.chip.wait.w1 { background: #fff4c2; color: #7a5b00; }
.chip.wait.w2 { background: #ffe1c2; color: #a04a00; }
.chip.wait.w3 { background: var(--magenta-soft); color: #a8005c; }
.list-empty { padding: 28px 18px; text-align: center; color: var(--muted); }

/* pannello chat */
.chat-pane { min-width: 0; min-height: 0; display: flex; background: var(--bg); }
.empty { margin: auto; text-align: center; padding: 24px; }
.empty-logo { width: min(300px, 70%); height: auto; margin-bottom: 8px; }
.empty h2 { margin: 6px 0 4px; font-weight: 600; }
.empty .btn { margin-top: 12px; }
.chat { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-title { display: grid; flex: 1; min-width: 0; }
.chat-title strong { font-weight: 500; }
.chat-title strong, .chat-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tools { display: flex; align-items: center; gap: 8px; }
.chat-tools select { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; max-width: 170px; }
.back { display: none; font-size: 28px; }
.read-by { padding: 6px 16px; font-size: 12.5px; color: var(--lime-text); background: var(--lime-soft); border-bottom: 1px solid #e3ec9a; font-weight: 500; }
.chat-body { flex: 1; display: flex; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 18px 6% 10px; display: flex; flex-direction: column; gap: 3px; background: #ededed; }
.day { align-self: center; background: #fff; color: var(--muted); font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 999px; margin: 12px 0 6px; box-shadow: var(--shadow); }
.more { align-self: center; margin: 4px 0 10px; }
.msg { max-width: min(640px, 82%); padding: 7px 10px 5px; border-radius: var(--radius); background: var(--bubble-in); box-shadow: var(--shadow); align-self: flex-start; position: relative; word-wrap: break-word; overflow-wrap: anywhere; color: var(--ink); }
.msg.out { align-self: flex-end; background: var(--bubble-out); }
.msg .who { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.msg .body { white-space: pre-wrap; line-height: 1.4; }
.msg .body a { color: #0b57d0; }
.msg img.media, .msg video.media { max-width: 100%; max-height: 360px; border-radius: 10px; display: block; margin-bottom: 4px; background: #0001; }
.msg audio { width: 260px; max-width: 100%; }
.msg img.sticker { max-width: 150px; }
.msg .doc { display: flex; align-items: center; gap: 10px; background: #0000000d; border-radius: 10px; padding: 9px 12px; color: inherit; text-decoration: none; margin-bottom: 4px; }
.msg .pending-media { color: var(--muted); font-style: italic; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0 4px; }
.msg .meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 2px; align-items: center; }
.msg .meta .by { font-weight: 600; color: var(--lime-text); }
.tick.read { color: var(--cyan); }
.msg .quote { border-left: 4px solid var(--lime); background: #0000000d; border-radius: 8px; padding: 5px 8px; margin-bottom: 5px; font-size: 13px; }
.msg .quote strong { display: block; font-size: 12px; }
.msg .quote span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg .msg-actions { position: absolute; top: 4px; right: 6px; display: flex; gap: 4px; opacity: 0; }
.msg .act-btn { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1px 7px; font-size: 13px; color: var(--ink); }
.msg .act-btn:hover { background: var(--lime-soft); border-color: var(--lime); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
@media (hover: none) { .msg .msg-actions { opacity: .75; } }

/* assegnatari nell'intestazione */
.assignees { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 280px; }
.assignees .chip { max-width: 130px; }

/* emoji */
.chat { position: relative; }
.emoji-pop { position: absolute; left: 12px; bottom: 74px; z-index: 40; border-radius: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.22); overflow: hidden; border: 1px solid var(--line); background: #fff; }
emoji-picker { width: 360px; height: 400px; max-width: calc(100vw - 24px); --num-columns: 8; --emoji-size: 1.45rem; --indicator-color: var(--lime); --input-border-color: var(--line); --input-font-color: var(--ink); --button-hover-background: var(--lime-soft); --category-font-color: var(--ink); font-family: "Rubik", sans-serif; }

/* inoltro */
.fwd-preview { background: var(--bg); border-left: 4px solid var(--lime); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; font-size: 13.5px; }
.fwd-preview span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fwd-list { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.fwd-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-weight: 400; }
.fwd-row:hover { background: #fafafa; }
.fwd-row input { width: auto; flex: none; }
.fwd-row .avatar { width: 34px; height: 34px; font-size: 13px; }
.fwd-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }

.notes { width: 300px; border-left: 1px solid var(--line); background: var(--panel); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.notes h3 { margin: 0; font-weight: 600; }
.note { background: #fffbd1; border: 1px solid #efe38a; border-radius: 10px; padding: 8px 10px; font-size: 13.5px; white-space: pre-wrap; color: var(--ink); }
.note .n-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; display: flex; justify-content: space-between; gap: 8px; }
.note .n-meta button { border: 0; background: transparent; color: var(--muted); padding: 0; }
#note-form { display: grid; gap: 8px; }
#note-form textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }

.quote-bar { display: flex; align-items: center; gap: 10px; padding: 6px 16px; background: #fff; border-top: 1px solid var(--line); }
.quote-bar > div { flex: 1; min-width: 0; border-left: 4px solid var(--lime); padding-left: 10px; display: grid; }
.quote-bar span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); background: var(--bg); border-radius: 22px; padding: 10px 16px; max-height: 160px; line-height: 1.35; }
.composer textarea:focus { border-color: var(--lime); background: #fff; outline: none; }
.composer .send { border-radius: 22px; padding: 10px 20px; }

/* modali */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 18px; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; display: grid; gap: 14px; border-top: 6px solid var(--lime); }
.modal-card header { display: flex; align-items: center; justify-content: space-between; }
.modal-card h2 { margin: 0; font-size: 19px; font-weight: 600; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink); }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.qr { width: 260px; max-width: 100%; margin: 6px auto; display: block; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.code-big { font-size: 34px; letter-spacing: .18em; font-weight: 700; text-align: center; padding: 14px; background: var(--lime-soft); border-radius: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.user-row .u-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 80; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.3); border-left: 6px solid var(--lime); }
.toast.err { background: var(--danger); border-left-color: #fff; }

/* menu col tasto destro */
.ctx { position: fixed; right: auto; bottom: auto; width: max-content; min-width: 230px; max-width: 320px; max-height: 80vh; overflow-y: auto; z-index: 60; padding: 4px 0; }
.ctx button { padding: 9px 14px; }
.ctx-title { padding: 8px 14px 6px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-sep { padding: 8px 14px 4px; font-size: 13px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); margin-top: 4px; }
.ctx-sep:empty { padding: 0; }
.ctx-strong { font-weight: 600; color: var(--ink); background: var(--lime-soft); }
.ctx-strong:hover { background: var(--lime); }
.ctx-on { font-weight: 600; color: var(--lime-text); }
.ctx-danger { color: var(--danger); }

/* dashboard */
.modal-card.wide { width: min(980px, 100%); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.dash-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; background: #fff; align-content: start; }
.dash-card.mine { border-color: var(--lime); box-shadow: 0 0 0 2px var(--lime-soft); }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dash-head > div { display: grid; }
.dash-big { font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1; }
.dash-stat { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; border-top: 1px solid #f0f0f0; padding-top: 6px; }
.dash-stat span { color: var(--muted); }
.dash-stat.warn strong { color: var(--magenta); }
.dash-card .btn { justify-self: start; margin-top: 4px; }

/* mobile */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-left-width: 6px; }
  .chat-pane { position: fixed; inset: 0; transform: translateX(100%); transition: transform .2s; z-index: 20; }
  body.chat-open .chat-pane { transform: none; }
  .back { display: inline-flex; }
  .messages { padding: 12px 10px 8px; }
  .msg { max-width: 90%; }
  .notes { position: absolute; inset: 0; width: auto; z-index: 5; }
  .chat-body { position: relative; }
  .chat-tools select { max-width: 120px; }
  #btn-take { display: none; }
  .login { padding: 24px 16px 24px 38px; }
  .login-rail { width: 22px; }
  .login-rail span { display: none; }
}

/* trascrizione dei vocali */
.transcript { background: rgba(0,0,0,.045); border-left: 3px solid var(--lime); border-radius: 8px; padding: 6px 10px; margin: 4px 0 2px; font-size: 14px; line-height: 1.4; max-width: 340px; }
.transcript .tr-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }

.gate { z-index: 200; background: rgba(20,20,20,.72); }
.gate .modal-card { max-width: 440px; display: grid; gap: 12px; }
.gate h2 { margin: 0; }
.gate p { margin: 0; line-height: 1.45; }

/* suggerimenti AI */
.suggest-bar { display: grid; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--bg); position: relative; }
.suggest-bar .sug { text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--lime); border-radius: 10px; padding: 8px 12px; font-size: 14px; line-height: 1.35; color: var(--ink); }
.suggest-bar .sug:hover { background: var(--lime-soft); }
.suggest-bar .sug-x { position: absolute; top: 2px; right: 6px; font-size: 12px; }

/* etichette */
.chip.label { color: #fff; font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-labels { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 240px; }
.label-filter { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); max-width: 150px; }
.lbl-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px; }
.lbl-row label { display: flex; align-items: center; gap: 10px; flex-direction: row; font-weight: 400; }
.lbl-row input { width: auto; }
.lbl-new { display: flex; gap: 8px; }
.lbl-new input { flex: 1; }

.summary { display: grid; gap: 6px; font-size: 14.5px; line-height: 1.45; }
.sum-li { padding-left: 16px; position: relative; }
.sum-li::before { content: '•'; position: absolute; left: 4px; color: var(--lime); font-weight: 700; }
.sum-p { margin-top: 6px; }

/* scheda cliente */
.card-body { gap: 18px; }
.card-sec h3 { margin: 0 0 8px; font-size: 15px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.card-row h3 { margin: 0; }
.card-dl { display: flex; gap: 6px; flex-wrap: wrap; }
.file-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.file-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink); }
.file-tabs button.active { background: var(--lime); border-color: var(--lime); font-weight: 500; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; }
.file-card { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-decoration: none; color: var(--ink); background: #fff; align-content: start; }
.file-card:hover { border-color: var(--lime); background: var(--lime-soft); }
.file-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.file-card.doc { text-align: center; padding: 14px 6px; }
.file-ico { font-size: 30px; }
.file-name { font-size: 12.5px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-meta { font-size: 11px; color: var(--muted); }

/* reazioni */
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 1px 8px; font-size: 13px; line-height: 1.5; }
.react.mine { background: var(--lime-soft); border-color: var(--lime); }
.react-bar { position: fixed; z-index: 120; display: flex; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.react-bar button { border: 0; background: transparent; font-size: 22px; padding: 2px 5px; border-radius: 50%; }
.react-bar button:hover { background: var(--lime-soft); transform: scale(1.15); }

/* freccia verso l'ultimo messaggio */
.chat-body { position: relative; }
.jump { position: absolute; right: 18px; bottom: 14px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 10; color: var(--ink); }
.jump:hover { background: var(--lime); border-color: var(--lime); }
.card-row.sub { padding-left: 14px; font-size: 14px; }

/* trascina i file sulla chat */
.drop-zone { position: absolute; inset: 0; z-index: 60; background: rgba(187,205,2,.22); border: 3px dashed var(--lime); border-radius: 14px; display: grid; place-items: center; pointer-events: none; }
.drop-zone div { background: #fff; border-radius: 14px; padding: 16px 26px; font-weight: 500; font-size: 17px; box-shadow: 0 8px 28px rgba(0,0,0,.2); }

/* messaggi modificati / eliminati */
.msg .deleted { color: var(--muted); font-style: italic; }
.msg .meta .edited { font-style: italic; margin-right: 6px; opacity: .8; }

/* suggerimento faccine */
.emoji-suggest { position: absolute; left: 12px; bottom: 74px; z-index: 45; display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.emoji-suggest button { border: 0; background: transparent; font-size: 24px; padding: 2px 6px; border-radius: 50%; line-height: 1.2; }
.emoji-suggest button:hover, .emoji-suggest button.first { background: var(--lime-soft); }
.emoji-suggest .hint { font-size: 11px; color: var(--muted); margin-left: 8px; white-space: nowrap; }

/* sondaggio, posizione, contatto */
.more-menu { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow: hidden; min-width: 170px; }
.more-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; font-size: 14.5px; color: var(--ink); }
.more-menu button:hover { background: var(--lime-soft); }
.poll-opts { display: grid; gap: 6px; }
.form label.check { display: flex; align-items: center; gap: 8px; flex-direction: row; font-weight: 400; }
.form label.check input { width: auto; }

/* bozze e vocali */
.draft { color: var(--magenta, #E5004E); font-weight: 500; }
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); background: #fff4f6; }
.rec-bar .rec-time { font-variant-numeric: tabular-nums; font-weight: 500; min-width: 40px; }
.rec-bar .btn:nth-of-type(1) { margin-left: auto; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #E5004E; animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { opacity: .25; } }
#btn-mic.recording { background: #E5004E22; border-radius: 50%; }

/* anteprima link */
.link-card { display: block; text-decoration: none; color: var(--ink); background: rgba(0,0,0,.05); border-left: 4px solid var(--lime); border-radius: 10px; overflow: hidden; margin: 4px 0; max-width: 340px; }
.link-card img { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.link-card .lc-text { display: grid; gap: 2px; padding: 8px 10px; }
.link-card .lc-site { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.link-card strong { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card .lc-desc { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.export-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.export-row label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }

.part-list { display: grid; max-height: 300px; overflow-y: auto; }
.part-list .card-row { flex-wrap: nowrap; }

.composer textarea, #text { min-height: 42px; }
