/* Reach: stile dell'app. Chiaro e scuro automatici, margini sicuri dell'iPhone, niente librerie. */
:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #0d1530; --ink2: #3b4560; --muted: #6b7591; --line: #e5e9f2; --soft: #eef2fb;
  --accent: #2f6bff; --accent2: #1f4fd6; --accent-soft: #e8efff; --on-accent: #ffffff;
  --red: #e5484d; --orange: #f76b15; --violet: #8e4ec6; --blue: #0090ff; --green: #2f9e6b; --gray: #8b8fa3; --yellow: #f5b300;
  --shadow: 0 1px 2px rgba(13, 21, 48, .05), 0 6px 20px rgba(13, 21, 48, .06);
  --r: 16px; --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* 29/10/2026 ("modalita' giorno con colori chiari, x Giulia"): Automatico segue il telefono, Giorno e Notte li sceglie la persona dal profilo */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="giorno"]) {
    --bg: #0a0f1f; --card: #131a2e; --ink: #edf1fb; --ink2: #c3cbe0; --muted: #8b95b3; --line: #232c45; --soft: #1a2238;
    --accent: #5b8cff; --accent2: #7aa2ff; --accent-soft: #1c2a52; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-tema="notte"] {
    --bg: #0a0f1f; --card: #131a2e; --ink: #edf1fb; --ink2: #c3cbe0; --muted: #8b95b3; --line: #232c45; --soft: #1a2238;
    --accent: #5b8cff; --accent2: #7aa2ff; --accent-soft: #1c2a52; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
}
/* 29/10/2026 (Cristina: "modalita' giorno caldo, colori chiari ma non accecanti, scritte nitide, colori caldi tipo hubspot"):
   crema invece del bianco, testo quasi nero caldo; ogni testo almeno 4.5:1 sul suo sfondo */
:root[data-tema="caldo"] {
    --bg: #f7f2eb; --card: #fffcf7; --ink: #2a211b; --ink2: #4d4038; --muted: #6e5f54; --line: #e9dfd2; --soft: #f3ebe0;
    --accent: #b9481a; --accent2: #9a3b14; --accent-soft: #fde9dd; --on-accent: #ffffff;
    --red: #c4352b; --orange: #b45309; --violet: #7b48b3; --blue: #1d6fb8; --green: #287a50; --gray: #756860; --yellow: #8f6400;
    --shadow: 0 1px 2px rgba(60, 38, 20, .06), 0 6px 20px rgba(60, 38, 20, .07);
    color-scheme: light;
}
.tema-btn { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--ink2); background: var(--card); border: 1px solid var(--line); }
.tema-btn:active { transform: scale(.94); }
@media (max-width: 600px) { .tema-btn { width: 32px; height: 32px; border: 0; background: none; } .tema-btn svg { width: 21px; height: 21px; } #root .head h1 { overflow: hidden; text-overflow: ellipsis; } }
/* 29/10/2026: Segnala */
.segn-prev { width: 100%; max-height: 220px; object-fit: contain; object-position: top; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
svg { width: 22px; height: 22px; display: block; flex: none; }
.hidden { display: none !important; }

/* ---------- impalcatura */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.page.push { z-index: 20; animation: entra .22s ease-out; box-shadow: -8px 0 24px rgba(0, 0, 0, .08); }
@keyframes entra { from { transform: translateX(30%); opacity: .4; } to { transform: none; opacity: 1; } }
.head { padding: calc(var(--top) + 10px) 18px 10px; display: flex; align-items: center; gap: 10px; background: var(--bg); position: relative; z-index: 2; }
.head h1 { font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -.02em; font-weight: 800; flex: 1; min-width: 0; }
.head h2 { font-size: 17px; margin: 0; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; font-weight: 500; }
.ibtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink2); flex: none; }
.ibtn:active { background: var(--soft); }
.ibtn.solid { background: var(--card); box-shadow: var(--shadow); }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(var(--bottom) + 96px); }
.page.push .body { padding-bottom: calc(var(--bottom) + 28px); }

/* ---------- barra delle schede */
.tabs { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  padding: 8px 6px calc(var(--bottom) + 6px); background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; position: relative; }
.tab.on { color: var(--accent); }
.tab .badge { position: absolute; top: 0; left: 50%; margin-left: 6px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- elementi */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin: 0 0 12px; overflow: hidden; }
.card.pad { padding: 14px 16px; }
.sect { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 20px 4px 8px; display: flex; align-items: center; gap: 8px; }
.sect .n { background: var(--soft); color: var(--ink2); border-radius: 8px; padding: 1px 7px; font-size: 12px; letter-spacing: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-height: 60px; width: 100%; text-align: left; }
.row:first-child { border-top: 0; }
.row:active { background: var(--soft); }
.row .main { flex: 1; min-width: 0; }
.row .t1 { font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; color: var(--muted); }
.row.unread .t1 { font-weight: 800; }
.row.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-left: -6px; }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; flex: none; letter-spacing: .02em; }
.av.l { width: 64px; height: 64px; font-size: 22px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-da_rispondere { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.st-interessato { color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.st-call { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.st-preventivo { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.st-trattativa { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.st-attesa, .st-contattato { color: var(--gray); background: color-mix(in srgb, var(--gray) 13%, transparent); }
.st-chiusa { color: var(--gray); background: var(--soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 16px;
  background: var(--accent); color: var(--on-accent); width: 100%; }
.btn:active { background: var(--accent2); }
.btn.sec { background: var(--soft); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; width: auto; }
.btn.danger { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.btn[disabled] { opacity: .5; }
.field { display: block; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 13px 14px; font-size: 16px; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { min-height: 110px; resize: vertical; line-height: 1.45; }
.label { font-size: 13px; color: var(--muted); font-weight: 600; margin: 14px 2px 6px; display: block; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 0 12px; box-shadow: var(--shadow); margin: 4px 0 12px; }
.search svg { color: var(--muted); width: 19px; height: 19px; }
.search input { flex: 1; border: 0; background: transparent; height: 46px; outline: none; font-size: 16px; min-width: 0; }
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--card); color: var(--ink2); font-weight: 650; font-size: 14px; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--bg); }
.chip .n { font-size: 12px; opacity: .7; }
.empty { text-align: center; color: var(--muted); padding: 50px 24px; font-size: 15px; line-height: 1.5; }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; opacity: .5; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: gira .8s linear infinite; margin: 40px auto; }
.spin.sm { width: 18px; height: 18px; border-width: 2.5px; margin: 0; }
@keyframes gira { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- oggi */
.hero { padding: 6px 4px 4px; }
.hero .count { font-size: 15px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.todo { padding: 14px 16px 12px; border-top: 1px solid var(--line); position: relative; }
.todo:first-child { border-top: 0; }
.todo .top { display: flex; align-items: flex-start; gap: 10px; }
.todo .az { font-weight: 750; font-size: 16.5px; flex: 1; min-width: 0; }
.todo .when { font-size: 12.5px; color: var(--muted); font-weight: 600; flex: none; margin-top: 2px; }
.todo .when.late { color: var(--red); }
.todo .desc { color: var(--ink2); font-size: 14px; margin-top: 4px; line-height: 1.4; }
.todo .quote { margin-top: 8px; font-size: 14px; color: var(--ink2); background: var(--soft); border-radius: 12px; padding: 9px 11px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sus { display: flex; gap: 9px; align-items: flex-start; margin-top: 9px; font-size: 14px; line-height: 1.4; color: var(--ink); }
.sus svg { width: 18px; height: 18px; color: var(--violet); margin-top: 1px; }
.sus b { color: var(--violet); font-weight: 700; }
.acts { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.act { height: 34px; padding: 0 12px; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 13.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.act svg { width: 17px; height: 17px; }
.act.pri { background: var(--accent); color: var(--on-accent); }
.act.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.ph { width: 4px; position: absolute; left: 0; top: 14px; bottom: 14px; border-radius: 0 4px 4px 0; }
.ph-1 { background: var(--red); } .ph-2 { background: var(--orange); } .ph-3 { background: var(--blue); } .ph-4 { background: var(--green); } .ph-0 { background: var(--gray); }
.appt { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.appt:first-child { border-top: 0; }
.appt .hour { font-weight: 800; font-size: 17px; width: 52px; color: var(--violet); }

/* ---------- pipeline */
.board { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 10px; scroll-snap-type: x mandatory; }
.col { flex: 0 0 82%; max-width: 340px; scroll-snap-align: start; }
.col h3 { font-size: 14px; margin: 4px 4px 8px; display: flex; align-items: center; gap: 8px; }
.mini { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 9px; width: 100%; text-align: left; display: block; }
.mini .t1 { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .t2 { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- scheda lead */
.lhero { display: flex; gap: 14px; align-items: center; padding: 6px 4px 14px; }
.lhero .nm { font-size: 23px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.lhero .ml { color: var(--muted); font-size: 14px; margin-top: 3px; word-break: break-all; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 8px; margin-bottom: 14px; }
.qa { background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 11px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink2); }
.qa svg { color: var(--accent); }
.qa[disabled] { opacity: .4; }
/* 30/10/2026 (Daniele: "solo icone"): anche sul computer, il nome compare passandoci sopra */
.quick { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); }
.quick .qa { font-size: 0; gap: 0; padding: 13px 2px; }
.tl { padding: 4px 0; }
.tli { display: flex; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.tli:first-child { border-top: 0; }
.tli .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--ink2); }
.tli .ic svg { width: 17px; height: 17px; }
.tli .k { font-size: 13px; font-weight: 700; }
.tli .x { font-size: 14px; color: var(--ink2); margin-top: 2px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.tli .q { font-size: 12px; color: var(--muted); margin-left: auto; flex: none; padding-left: 8px; }
.kv { display: flex; padding: 11px 16px; border-top: 1px solid var(--line); gap: 12px; font-size: 15px; }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--muted); width: 110px; flex: none; font-size: 14px; }
.kv .v { flex: 1; min-width: 0; word-break: break-word; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 12px 6px; }
.stats3 b { display: block; font-size: 20px; }
.stats3 span { font-size: 12px; color: var(--muted); }
.bub { max-width: 88%; border-radius: 16px; padding: 10px 13px; margin: 8px 0; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bub.loro { background: var(--card); box-shadow: var(--shadow); border-top-left-radius: 5px; }
.bub.noi { background: var(--accent); color: var(--on-accent); margin-left: auto; border-top-right-radius: 5px; }
.bub .m { font-size: 11.5px; opacity: .7; margin-bottom: 4px; font-weight: 600; }

/* ---------- posta */
.mailhead { padding: 4px 4px 12px; }
.mailhead .ogg { font-size: 21px; font-weight: 800; line-height: 1.25; margin-bottom: 10px; }
.mailhead .who { display: flex; gap: 11px; align-items: center; }
.mailhead .meta { font-size: 13px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.mailbody { background: #fff; color: #111; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.mailbody iframe { width: 100%; border: 0; display: block; min-height: 120px; background: #fff; }
.mailbody pre { white-space: pre-wrap; word-break: break-word; font: 15px/1.5 var(--font); margin: 0; padding: 14px 16px; }
.att { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.mailbar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px 16px calc(var(--bottom) + 10px); background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.mailbar .btn { height: 44px; font-size: 15px; }
.comp .rowf { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.comp .rowf label { color: var(--muted); font-size: 15px; width: 58px; flex: none; }
.comp .rowf input { flex: 1; border: 0; background: transparent; height: 48px; outline: none; font-size: 16px; min-width: 0; }
.comp textarea { width: 100%; border: 0; background: transparent; outline: none; min-height: 260px; padding: 14px 2px; font-size: 16px; line-height: 1.5; resize: none; }
.attlist { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.attlist .chip { box-shadow: none; background: var(--soft); }
.fab { position: absolute; right: 18px; bottom: calc(var(--bottom) + 82px); width: 58px; height: 58px; border-radius: 20px; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent); z-index: 9; }
.fab svg { width: 26px; height: 26px; }

/* ---------- numeri */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; display: block; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chartw { padding: 14px 12px 8px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 0 4px 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.msg { border-radius: 16px; padding: 11px 13px; font-size: 14.5px; line-height: 1.45; max-width: 92%; word-break: break-word; }
.msg.io { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.msg.lei { background: var(--card); box-shadow: var(--shadow); align-self: flex-start; border-bottom-left-radius: 5px; overflow-x: auto; }
.msg.lei table { border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.msg.lei td, .msg.lei th { border-bottom: 1px solid var(--line); padding: 5px 7px; text-align: left; white-space: nowrap; }
.msg.lei ul, .msg.lei ol { padding-left: 18px; margin: 6px 0; }
.ex { display: block; width: 100%; text-align: left; background: var(--card); box-shadow: var(--shadow); border-radius: 12px; padding: 11px 13px; font-size: 14px; margin-bottom: 8px; color: var(--ink2); }
.askbar { display: flex; gap: 8px; align-items: flex-end; }
.askbar textarea { flex: 1; min-height: 46px; max-height: 120px; border-radius: 14px; }
.askbar .ibtn { background: var(--accent); color: #fff; width: 46px; height: 46px; border-radius: 14px; }

/* ---------- foglio dal basso, avvisi */
.veil { position: fixed; inset: 0; background: rgba(5, 10, 25, .42); z-index: 50; animation: sfuma .18s ease-out; }
@keyframes sfuma { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg); border-radius: 22px 22px 0 0; max-height: 92%; display: flex; flex-direction: column;
  animation: sale .24s cubic-bezier(.2, .9, .3, 1); padding-bottom: var(--bottom); }
@keyframes sale { from { transform: translateY(100%); } }
.sheet .grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 2px; flex: none; }
.sheet .sh { display: flex; align-items: center; padding: 8px 16px 6px; gap: 8px; }
.sheet .sh h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; }
.sheet .sb { overflow-y: auto; padding: 4px 16px 18px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.opt { background: var(--card); box-shadow: var(--shadow); border-radius: 13px; padding: 13px 12px; font-weight: 650; font-size: 14.5px; text-align: left; }
.opt::first-letter { text-transform: uppercase; }
.opt.on { outline: 2px solid var(--accent); color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 92px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px;
  font-weight: 650; font-size: 14.5px; z-index: 80; box-shadow: var(--shadow); animation: sale .2s ease-out; max-width: 90%; text-align: center; }

/* ---------- accesso */
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--top) + 30px) 26px calc(var(--bottom) + 30px); max-width: 460px; margin: 0 auto; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.brand .mark { width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg, #2f6bff, #6e46ff); display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 26px rgba(47, 107, 255, .35); }
.brand .mark svg { width: 30px; height: 30px; stroke-width: 2.2; }
.brand .w { font-size: 30px; font-weight: 850; letter-spacing: -.02em; }
.brand .w small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.login h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.login p { color: var(--muted); margin: 0 0 22px; line-height: 1.45; }
.login .field { margin-bottom: 12px; }
.code { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 800; }
.err { color: var(--red); font-size: 14px; font-weight: 600; min-height: 20px; margin: 4px 2px 8px; }
.splash { flex: 1; display: grid; place-items: center; }
@media (min-width: 760px) { .body { max-width: 760px; margin: 0 auto; width: 100%; } .col { flex-basis: 300px; } }

/* ---------- tre colonne sugli schermi larghi (16/10): menu e cartelle | elenco | dettaglio */
#dettaglio { display: contents; }
.navbrand, .vuoto, .navx { display: none; }
.sel { background: var(--accent-soft) !important; }
@media (min-width: 1000px) {
  .tabs { top: 0; bottom: 0; right: auto; width: 236px; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px;
    padding: calc(var(--top) + 18px) 12px 16px; border-top: 0; border-right: 1px solid var(--line); background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; overflow-y: auto; }
  .tab { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 10px 12px; border-radius: 12px; justify-content: flex-start; color: var(--ink2); }
  .tab span:not(.badge) { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tab.on { background: var(--accent-soft); color: var(--accent); }
  .tab:hover { background: var(--soft); }
  .tab .badge { position: static; margin-left: auto; }
  .navbrand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-size: 22px; }
  .navbrand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #2f6bff, #6e46ff); display: grid; place-items: center; color: #fff; }
  .navbrand .mark svg { width: 20px; height: 20px; }
  .navx { display: block; }
  #root { left: 236px; right: auto; width: 420px; border-right: 1px solid var(--line); }
  #root .body { padding-bottom: 28px; max-width: none; }
  #root .head h1 { font-size: 26px; }
  #dettaglio { display: block; position: absolute; left: 656px; right: 0; top: 0; bottom: 0; background: var(--bg); overflow: hidden; }
  #dettaglio .page.push { animation: sfuma .15s ease-out; box-shadow: none; }
  #dettaglio .body { max-width: 860px; margin: 0 auto; width: 100%; }
  .vuoto { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--muted); gap: 12px; font-weight: 600; }
  .vuoto svg { width: 54px; height: 54px; opacity: .35; }
  .fab { bottom: 24px; }
  .row:hover, .mini:hover { background: var(--soft); }
  .todo { cursor: pointer; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 8%; transform: translateX(-50%); width: 560px; max-height: 84%; border-radius: 22px; animation: sfuma .18s ease-out; padding-bottom: 0; }
  .sheet .grip { display: none; }
  .mailbar { position: sticky; }
  .toast { bottom: 28px; }
  .col { flex-basis: 260px; }
}
@media (min-width: 1400px) { #root { width: 480px; } #dettaglio { left: 716px; } }

/* ---------- editor delle email (16/10) */
.tb { display: flex; gap: 4px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tb::-webkit-scrollbar { display: none; }
.tb button { min-width: 36px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--ink2); font-size: 15px; flex: none; }
.tb button:active, .tb button:hover { background: var(--soft); }
.tb button svg { width: 18px; height: 18px; }
.tb .sus { margin-left: auto; display: inline-flex; gap: 6px; padding: 0 10px; background: var(--soft); font-weight: 650; font-size: 13.5px; }
.editor { min-height: 240px; outline: none; padding: 14px 2px; font-size: 16px; line-height: 1.5; word-break: break-word; }
.editor:empty::before { content: attr(data-ph); color: var(--muted); }
.editor a { color: var(--accent); text-decoration: underline; }
.editor ul, .editor ol { padding-left: 22px; }
.prec { margin: 18px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
.prec summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; list-style: none; display: flex; gap: 8px; align-items: center; }
.prec summary .n { background: var(--soft); color: var(--ink2); border-radius: 8px; padding: 1px 7px; font-size: 12px; letter-spacing: 0; }

/* 22/10/2026: lettore delle videochiamate registrate, come YouTube (scuro, video grande, trascrizione a lato) */
.vw { position: fixed; inset: 0; z-index: 60; background: #0f0f10; color: #f1f1f1; display: flex; flex-direction: column; outline: none; }
.vw .ibtn { color: #f1f1f1; }
.vw-top { display: flex; align-items: center; gap: 10px; padding: calc(var(--top) + 8px) 14px 8px; }
.vw-tit { display: flex; flex-direction: column; min-width: 0; } .vw-tit b { font-size: 17px; } .vw-tit span { color: #aaa; font-size: 13px; text-transform: capitalize; }
.vw-body { flex: 1; min-height: 0; display: flex; gap: 18px; padding: 0 18px calc(var(--bottom) + 12px); overflow: auto; }
.vw-main { flex: 1 1 66%; min-width: 0; }
.vw-schermo { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.vw-schermo video { width: 100%; height: 100%; display: block; background: #000; }
.vw-fil { position: absolute; pointer-events: none; color: rgba(255,255,255,.22); font-size: 12px; font-weight: 600; white-space: nowrap; transition: top 2s, left 2s; text-shadow: 0 0 2px rgba(0,0,0,.5); }
.vw-vuoto { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: #bbb; }
.vw-vuoto span { width: 44px; display: flex; color: #777; } .vw-vuoto p { max-width: 420px; line-height: 1.45; margin: 0; }
.vw-barra { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 2px; }
.vw-vel { background: #272727; color: #f1f1f1; border: 0; border-radius: 16px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.vw-vel.on { background: #f1f1f1; color: #0f0f0f; }
.vw-priv { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #9a9a9a; font-size: 12px; } .vw-priv svg { width: 14px; height: 14px; }
.vw-cap { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.vw-ch { flex: 0 0 auto; max-width: 230px; text-align: left; background: #1f1f1f; color: #f1f1f1; border: 1px solid #2c2c2c; border-radius: 10px; padding: 8px 11px; font-size: 13px; line-height: 1.3; cursor: pointer; }
.vw-ch span { display: block; color: #3ea6ff; font-size: 12px; font-weight: 700; margin-bottom: 2px; } .vw-ch.on { border-color: #3ea6ff; background: #1b2633; }
.vw-lato { flex: 1 1 34%; min-width: 300px; display: flex; flex-direction: column; background: #181818; border-radius: 12px; overflow: hidden; max-height: calc(100vh - var(--top) - var(--bottom) - 90px); }
.vw-tabs { display: flex; border-bottom: 1px solid #2a2a2a; } .vw-tabs button { flex: 1; background: none; border: 0; color: #aaa; padding: 12px; font-weight: 600; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; }
.vw-tabs button.on { color: #f1f1f1; border-bottom-color: #f1f1f1; }
.vw-pan { flex: 1; overflow-y: auto; padding: 12px 14px; }
.vw-ria { white-space: pre-wrap; line-height: 1.55; font-size: 14px; color: #e6e6e6; }
.vw-riga { display: flex; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.45; color: #d6d6d6; }
.vw-riga:hover { background: #242424; } .vw-riga.on { background: #263850; color: #fff; }
.vw-ora { flex: 0 0 auto; min-width: 52px; color: #3ea6ff; font-size: 12px; font-weight: 700; padding-top: 2px; }
@media (max-width: 899px) {
  .vw-body { flex-direction: column; padding: 0 0 calc(var(--bottom) + 8px); gap: 10px; }
  .vw-schermo { border-radius: 0; } .vw-barra, .vw-cap { padding-left: 12px; padding-right: 12px; }
  .vw-lato { min-width: 0; border-radius: 0; max-height: none; flex: 1 0 auto; } .vw-priv { width: 100%; margin-left: 0; }
}
.vw-nota { margin: 10px 2px 0; padding: 9px 12px; background: #1f1f1f; border-radius: 10px; color: #c9c9c9; font-size: 13px; line-height: 1.4; }

/* 22/10/2026: Da fare (come Todoist) */
.df-viste { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; } .df-viste::-webkit-scrollbar { display: none; }
.df-viste .chip svg { width: 13px; height: 13px; }
.df-pal { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.df-add { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 6px 4px 14px; margin: 4px 0 12px; }
.df-add > span { width: 20px; display: flex; color: var(--accent); } .df-add input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; padding: 12px 0; color: var(--ink); min-width: 0; }
.df-testa { display: flex; align-items: center; gap: 10px; margin: 6px 4px 8px; } .df-testa b { font-size: 18px; } .df-testa .ibtn { margin-left: auto; }
.df-card { padding: 2px 0; }
.df-riga { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; text-align: left; background: none; }
.df-riga:first-child { border-top: 0; }
.df-cerchio { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); color: transparent; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: background .15s; }
.df-cerchio svg { width: 13px; height: 13px; }
.df-cerchio:hover { color: var(--c); }
.df-riga.fatto .df-cerchio { background: var(--c); color: #fff; }
.df-riga.fatto .df-tit { text-decoration: line-through; color: var(--muted); }
.df-testo { flex: 1; min-width: 0; cursor: pointer; }
.df-tit { font-size: 15.5px; line-height: 1.35; word-break: break-word; }
.df-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.df-meta span { display: inline-flex; align-items: center; gap: 4px; } .df-meta svg { width: 12px; height: 12px; }
.df-due { display: flex; gap: 10px; margin-top: 10px; } .df-due label { flex: 1; font-size: 13px; color: var(--muted); font-weight: 600; } .df-due .field { margin-top: 4px; }
/* 01/11/2026: etichette e allegati del Da fare */
.df-tag { color: var(--accent); cursor: pointer; font-weight: 600; }
.df-mini { flex: none; width: 42px; height: 42px; border-radius: 9px; object-fit: cover; cursor: zoom-in; background: var(--line); }
.df-sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .df-sug:empty { display: none; }
.df-file { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; } .df-file:empty { display: none; }
.df-ft { position: relative; width: 86px; height: 86px; border-radius: 11px; overflow: hidden; background: color-mix(in srgb, var(--ink) 7%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; cursor: pointer; color: var(--muted); font-size: 11px; text-align: center; }
.df-ft > img, .df-ft > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.df-ft > svg { width: 20px; height: 20px; }
.df-ft .nm { line-height: 1.2; max-height: 2.4em; overflow: hidden; word-break: break-all; }
.df-ft .ps { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; font-size: 10px; color: #fff; background: rgba(0, 0, 0, .45); z-index: 1; }
.df-ft .play { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: flex; align-items: center; justify-content: center; } .df-ft .play svg { width: 15px; height: 15px; }
.df-ft .x { position: absolute; top: 4px; right: 4px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; padding: 0; background: rgba(0, 0, 0, .55); color: #fff; display: flex; align-items: center; justify-content: center; } .df-ft .x svg { width: 12px; height: 12px; }
.df-ft .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); z-index: 3; transition: width .2s; }
.df-vis { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .94); display: flex; align-items: center; justify-content: center; outline: none; padding: calc(env(safe-area-inset-top) + 56px) 10px calc(env(safe-area-inset-bottom) + 40px); }
.df-vis img, .df-vis video { max-width: 100%; max-height: 100%; object-fit: contain; } .df-vis audio { width: min(520px, 100%); }
.df-vis .tb { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 10px; display: flex; gap: 8px; }
.df-vis .tb button { width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; } .df-vis .tb svg { width: 20px; height: 20px; }
.df-vis .nm { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 12px); text-align: center; color: #ccc; font-size: 13px; padding: 0 16px; }
.df-scorciatoie, .df-prio { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.df-amici { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; } .df-amico { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.df-mostra { display: block; margin: 6px auto 12px; color: var(--muted); font-size: 14px; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 8px; }
.df-nuovo .df-cerchio { border-style: dashed; color: var(--muted); }
/* 01/11/2026: sottocompiti annidati, liste informative, In attesa, import da Todoist */
.df-riga.df-sub { padding-left: calc(14px + var(--liv, 1) * 26px); border-top-style: dashed; }
.df-riga.df-sub .df-cerchio { width: 19px; height: 19px; }
.df-punto { flex: none; width: 22px; height: 22px; margin-top: 1px; display: flex; align-items: center; justify-content: center; color: var(--accent); } .df-punto svg { width: 16px; height: 16px; }
.df-anteprima { margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.4; white-space: pre-line; max-height: 2.8em; overflow: hidden; }
.df-att { color: var(--orange); font-weight: 600; }
.df-add-sub { box-shadow: none; border: 1px dashed var(--line); margin: 8px 0 4px; } .df-add-sub input { padding: 9px 0; font-size: 15px; }
.df-imp-p { margin: 2px 2px 12px; line-height: 1.45; }
.df-imp-err { margin: 10px 2px 0; color: var(--red); font-weight: 600; }
.df-imp-pr { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; transition: opacity .15s; }
.df-imp-pr.spento { opacity: .55; }
.df-imp-tit { display: flex; align-items: center; gap: 8px; font-size: 15.5px; margin-bottom: 2px; } .df-imp-tit svg { width: 13px; height: 13px; color: var(--muted); }
.df-imp-warn { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--red); font-weight: 600; } .df-imp-warn svg { width: 13px; height: 13px; }
.df-imp-pr .df-mostra { margin: 8px 0 0; padding: 4px 0; }
.df-imp-sez { margin: 10px 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.df-imp-c { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 14.5px; line-height: 1.35; } .df-imp-c.sotto { padding-left: 24px; }
.df-imp-c input { margin-top: 3px; flex: none; } .df-imp-c small { white-space: nowrap; } .df-imp-c svg { width: 11px; height: 11px; vertical-align: -1px; }
.df-imp-sens { color: var(--red); font-weight: 700; }
.df-imp-piede { display: flex; gap: 10px; position: sticky; bottom: 0; padding: 10px 0 4px; background: var(--bg); }
.df-imp-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; } .df-imp-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.df-imp-ries { margin: 12px 0 0; padding-left: 20px; line-height: 1.6; }
.st-cliente { color: var(--violet); background: color-mix(in srgb, var(--violet) 13%, transparent); }
.st-fornitore, .st-collaboratore { color: var(--gray); background: var(--soft); }
.st-team { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.st-collaboratore { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.st-privato { color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); }

/* 27/10/2026 (Daniele: "meglio metterne 5 e poi le altre in 3 puntini"): sul telefono 5 voci e Altro; sul computer il menu intero */
@media (max-width: 999px) { .tab.extra { display: none; } }
@media (max-width: 999px) { .tab { order: var(--o, 50); } .tab.altro { order: 90; } }   /* 07/11/2026: ordine della barra scelto da ognuno */
.altro-lista button.pers { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; color: var(--muted); font-size: 15px; }
.barra-pers .bp-t { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 4px 6px; }
.barra-pers .bp-t:not(:first-child) { margin-top: 18px; }
.barra-pers .bp-r { display: flex; align-items: center; gap: 12px; padding: 6px 4px 6px 10px; border-radius: 12px; font-weight: 600; }
.barra-pers .bp-r > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.barra-pers .bp-r > span { flex: 1; min-width: 0; }
.barra-pers .ibtn.su svg { transform: rotate(-90deg); }
.barra-pers .ibtn.giu svg { transform: rotate(90deg); }
.barra-pers .ibtn:disabled { opacity: .3; }
@media (min-width: 1000px) { .tab.altro { display: none; } }
.altro-lista { display: grid; gap: 4px; padding-bottom: 8px; }
.altro-lista button { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--ink); text-align: left; background: none; border: 0; }
.altro-lista button svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.altro-lista button.on { background: var(--accent-soft); color: var(--accent); }
.altro-lista button.on svg { color: var(--accent); }

/* 28/10/2026: foto delle persone sopra le iniziali */
.av { position: relative; overflow: hidden; }
.av .av-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* 29/10/2026: Persone dell'azienda */
.pp .pill { background: var(--accent-soft); color: var(--accent); }
.pp .pill svg, .pp .chip svg, .pp .btn svg { width: 14px; height: 14px; }
.pp .chip { height: 30px; padding: 0 11px; font-size: 13px; }
/* 29/10/2026: indirizzo del lead sotto l'email; sul telefono i tasti rapidi della scheda solo con l'icona (il testo andava a capo) */
.lhero .ind { display: flex; gap: 5px; align-items: flex-start; color: var(--ink2); text-decoration: none; margin-top: 4px; }
.lhero .ind svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
.lhero .ind.hidden { display: none; }
@media (max-width: 700px) { .quick { grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); gap: 6px; } .quick .qa { font-size: 0; gap: 0; padding: 13px 2px; } }
/* 29/10/2026: Oggi a tre schede */
.hoy-tabs { margin: 4px 0 12px; }
.hoy-tabs .chip .n { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; font-size: 12px; background: var(--soft); color: var(--ink2); }
.hoy-tabs .chip.hoy-late .n { background: var(--red); color: #fff; }
.hoy-tabs .chip.hoy-today .n { background: var(--blue); color: #fff; }
/* 29/10/2026: Target */
.tg-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tg-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--ink2); font-size: 12px; font-weight: 600; }
.tg-tag.tg-p { background: var(--accent-soft); color: var(--accent); }
.tg-chipin { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); min-height: 46px; }
.tg-chipin .tg-in { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 4px; }
.tg-row .t1 .pill { vertical-align: middle; }
/* 29/10/2026 Target: numeri, passaggi, raccolte */
.tg-fun { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tg-st { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--soft); border: 0; color: var(--ink); text-align: left; cursor: pointer; min-width: 0; }
.tg-st b { font-size: 17px; font-weight: 800; }
.tg-st span { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.tg-st.on { background: rgba(47, 158, 107, .14); }
.tg-st.on b { color: var(--green); }
.tg-mini { color: var(--ink2); margin-top: 3px; }
.tg-bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.tg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
@media (max-width: 420px) { .tg-fun { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 30/10/2026: la ruota del follow-up: la data della riga si tocca, bottoni rapidi, calendarino, dettatura */
.todo button.when { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; margin: -1px -6px 0 0; border-radius: 9px; background: var(--soft); color: var(--muted); }
.todo button.when.late { color: var(--red); background: rgba(229, 72, 77, .1); }
.todo button.when svg { width: 13px; height: 13px; }
.rip { margin-top: 12px; }
.qdate { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0 4px; }
.qk { height: 34px; padding: 0 13px; border-radius: 17px; background: var(--card); box-shadow: var(--shadow); color: var(--ink2); font-weight: 650; font-size: 14px; }
.qk.on { background: var(--accent); color: var(--on-accent); }
.rip-info { margin: 6px 2px 0; min-height: 1.2em; }
.rip-info::first-letter { text-transform: uppercase; }
.cal { background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 8px 10px 10px; margin-top: 8px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; }
.cal-h b { font-size: 15px; }
.cal-h b::first-letter, .qk::first-letter { text-transform: uppercase; }
.cal-h b { display: inline-block; }
.cal-h .ibtn { width: 34px; height: 34px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-g i { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; padding: 4px 0; }
.cg { height: 36px; border-radius: 10px; font-weight: 650; font-size: 14.5px; color: var(--ink); }
.cg.fest { color: var(--muted); }
.cg.oggi { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cg.on { background: var(--accent); color: var(--on-accent); }
.cg:disabled { opacity: .3; }
.btn.mic { display: inline-flex; align-items: center; gap: 6px; }
.btn.mic.on { background: var(--red); color: #fff; animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 50% { opacity: .75; } }
/* 30/10/2026 (Daniele: "sull'app telefono c'e' troppa roba in alto, non si vede piu' Hola Daniele"): sul telefono campanella, + e profilo;
   aggiorna = tirare giu' la lista, tema e Segnala nel profilo */
.tira { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--muted); transition: height .2s ease; }
.tira svg { transition: transform .2s ease; }
.tira.pronto { color: var(--accent); }
.tira.pronto svg { transform: rotate(180deg); }
@media (max-width: 600px) {
  .head .solo-largo, .head .tema-btn { display: none; }
  #root .head { gap: 4px; padding-right: 12px; }
  #root .head h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #root .head [data-hx] { gap: 2px !important; }
}
/* 30/10/2026: Salientes in diretta, le email partite diventano verdi e spariscono, quelle entrate in coda lampeggiano */
.viv { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--green); font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.viv::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: vivPulsa 1.6s ease-in-out infinite; }
@keyframes vivPulsa { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }
.viv-np { margin: -2px 6px 8px; font-size: 13px; font-weight: 700; color: var(--green); }
.row.viv-new { animation: vivNuova 3s ease-out; }
@keyframes vivNuova { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.row.viv-out { background: #e3f5ea; background: color-mix(in srgb, var(--green) 18%, var(--card)); transition: background .35s ease; }
.row.viv-out .side, .row.viv-out .t1 { color: var(--green); }
.viv-ok { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; }
.viv-ok svg { width: 18px; height: 18px; }
.row.viv-in { background: var(--accent-soft); transition: background .35s ease; }
.row.viv-in .side { color: var(--accent); font-weight: 700; }
.row.viv-stop { opacity: .45; transition: opacity .4s ease; }
.row.viv-gone { max-height: 0 !important; min-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-top-color: transparent;
  transition: max-height .5s ease, opacity .4s ease, padding .5s ease, min-height .5s ease; }

/* 30/10/2026: quello che e' appena cambiato (occhio sulle caselle) si illumina un momento */
.row.viv-flash, .todo.viv-flash { animation: vivNuova 2.6s ease-out; }
/* 01/11/2026 notte: link, sottocompiti chiudibili, trascinamento, bacheca, sottoliste */
.df-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.df-riga { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.df-riga.con-freccia { padding-left: 4px; }
.df-riga.df-sub.con-freccia { padding-left: calc(4px + var(--liv, 1) * 26px); }
.df-freccia { flex: none; width: 22px; height: 24px; margin-right: -6px; padding: 0; border: 0; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.df-freccia svg { width: 14px; height: 14px; transition: transform .15s; } .df-freccia.aperta svg { transform: rotate(90deg); }
.df-figli[hidden] { display: none; }
.df-figli > .df-riga { border-top: 1px dashed var(--line); }
.df-su { position: relative; z-index: 60; background: var(--card); box-shadow: 0 10px 28px rgba(0, 0, 0, .28); border-radius: 12px; opacity: .96; pointer-events: none; }
body.df-trascinando, body.df-trascinando * { cursor: grabbing !important; }
.df-segno { height: 3px; margin: 2px 12px; border-radius: 2px; background: var(--accent); }
.df-card.vuota { min-height: 44px; }
.df-sez-tit { cursor: pointer; }
.df-testa .df-padre { background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.df-viste .chip.df-figlia { font-size: 13px; opacity: .9; }
.df-sottoliste { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; } .df-sottoliste .sect { flex-basis: 100%; }
.df-bacheca { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px; scroll-snap-type: x proximity; align-items: flex-start; }
.df-col { flex: 0 0 min(300px, 84vw); scroll-snap-align: start; min-width: 0; }
.df-col-tit { display: flex; align-items: center; gap: 8px; margin: 4px 6px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.df-col-tit[data-sez] { cursor: pointer; } .df-col-tit b { color: var(--ink2); font-weight: 700; }
.df-col-corpo { min-height: 60px; }
.df-col-add { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--line); }
.df-col-add > span { display: flex; width: 16px; color: var(--accent); } .df-col-add input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; padding: 8px 0; color: var(--ink); }
.df-col-nuova { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; border: 1px dashed var(--line); border-radius: var(--r); background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.df-col-nuova svg { width: 14px; height: 14px; }
.df-mostra svg { width: 13px; height: 13px; vertical-align: -2px; }
/* 02/11/2026: ricerca nel Da fare (parole + significato, ricerche suggerite) e foto caricate col login */
.df-cerca { margin: 0 0 10px; box-shadow: none; border: 1px solid var(--line); }
.df-cerca > span { color: var(--muted); }
.df-cerca input { padding: 10px 0; }
.df-cerca [data-xc][hidden] { display: none; }
.df-in-cerca > :not(.df-cerca):not(.df-sugg):not(.df-risultati) { display: none !important; }
.df-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 14px; }
.df-sugg[hidden] { display: none; }
.df-sugg .sect { width: 100%; margin: 0 0 2px; }
.df-sg { display: inline-flex; align-items: center; gap: 5px; padding-right: 4px; }
.df-sg > svg { width: 14px; height: 14px; opacity: .7; }
.df-sg button { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.df-sg [data-t] { display: flex; padding: 2px; }
.df-sg [data-t] svg { width: 13px; height: 13px; opacity: .5; }
.df-risultati .df-testa .chip svg { width: 14px; height: 14px; }
.df-nota { margin: 10px 4px; }
img[data-dff]:not([src]) { background: var(--soft); }
img.rotta { visibility: hidden; }
/* 02/11/2026: @persona nel Da fare (commenti, scheda Per me) */
.df-tag-hint { margin: 6px 2px 0; display: flex; gap: 6px; align-items: center; color: var(--accent); }
.df-tag-hint svg { width: 14px; height: 14px; }
.df-com-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.df-com { background: var(--soft); border-radius: 12px; padding: 8px 12px; }
.df-com.mio { background: var(--accent-soft); }
.df-com-testa { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.df-com-testa .ibtn { margin-left: auto; width: 26px; height: 26px; }
.df-com-testa .ibtn svg { width: 13px; height: 13px; }
.df-com-testo { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.df-perme-da { display: flex; gap: 6px; align-items: center; }
.df-perme-da svg { width: 14px; height: 14px; }
.df-perme-tit { font-size: 18px; font-weight: 700; margin-top: 6px; word-break: break-word; }
.df-perme-note { margin-top: 8px; color: var(--ink2); word-break: break-word; }
/* 02/11/2026: Hoy, WhatsApp e LinkedIn da gestire */
.es-voce .top { align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.es-voce .top .az { flex: 1; min-width: 0; }
.es-voce .top .when { flex-basis: 100%; padding-left: 30px; margin: 0; text-align: left; }
.es-fonte { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 12px; }
.es-fonte.wa { background: #25d366; } .es-fonte.wa svg { width: 14px; height: 14px; }
.es-fonte.li { background: #0a66c2; font-family: Arial, sans-serif; }
.es-tit { font-weight: 600; margin-top: 4px; }
.es-lungo { max-height: 220px; overflow: auto; }
.es-az { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: flex-end; }

/* 05/11/2026: il messaggio intero in Oggi, i nomi che portano alla scheda */
.todo .quote { cursor: pointer; }
.todo .quote.tutto { display: block; -webkit-line-clamp: unset; overflow: visible; max-height: none; }
.es-chi, .df-lead { cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
/* 05/11/2026: Reach senza connessione, con l'ultima copia sul dispositivo */
#offbar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 9999;
  background: #e8590c; color: #fff; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* 05/11/2026: Sistema la scheda */
.sz-riga { gap: 6px; }
.sz-riga.sz-spenta .t1 { opacity: .45; text-decoration: line-through; }
.sz-on input { width: 20px; height: 20px; accent-color: var(--accent); }
.sz-riga .ibtn[disabled] { opacity: .25; }

/* 05/11/2026: sul computer i fogli con un titolo sono un pannello nella colonna di destra (foglio() in app.js) */
@media (min-width: 1000px) {
  .sheet.pannello { left: 656px; right: 0; top: 0; bottom: 0; transform: none; width: auto; max-height: none; border-radius: 0; z-index: 40;
    border-left: 1px solid var(--line); animation: sfuma .15s ease-out; box-shadow: none; }
  .sheet.pannello .sh { padding: calc(var(--top) + 18px) 24px 8px; max-width: 860px; width: 100%; margin: 0 auto; }
  .sheet.pannello .sh h3 { font-size: 22px; }
  .sheet.pannello .sb { flex: 1; min-height: 0; padding: 4px 24px 28px; max-width: 860px; width: 100%; margin: 0 auto; }
  body.crm-largo .sheet.pannello { left: auto; width: min(720px, 60vw); box-shadow: -12px 0 40px rgba(0, 0, 0, .18); }
}
@media (min-width: 1400px) { body:not(.crm-largo) .sheet.pannello { left: 716px; } }
/* 15/11/2026: maniglia per trascinare (sul telefono parte subito, senza pressione lunga) e segno rientrato quando la voce va sotto un'altra */
.df-presa { display: none; flex: none; align-self: center; width: 28px; height: 34px; margin: -8px -8px -8px 0; color: var(--muted); opacity: .6; touch-action: none; align-items: center; justify-content: center; }
.df-presa svg { width: 15px; height: 15px; }
[data-drop] .df-presa { display: flex; }
@media (hover: hover) { [data-drop] .df-presa { opacity: 0; cursor: grab; } [data-drop] .df-riga:hover .df-presa { opacity: .6; } }
.df-segno { transition: margin-left .12s; }
/* 15/11/2026: il titolo nella scheda della voce si legge tutto, come le note */
textarea.field.df-tit-campo { resize: none; overflow: hidden; min-height: 44px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
/* 15/11/2026: linguette del Por hacer trascinabili col mouse (segno dove cade) e stella "si apre qui" */
.df-tab-segno { flex: none; width: 3px; align-self: stretch; border-radius: 2px; background: var(--accent); }
.df-viste .chip.df-su { position: relative; z-index: 60; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
@media (hover: hover) { .df-viste { cursor: grab; } }
.df-stella.on { color: #f5b301; }
.df-stella.on svg { fill: currentColor; }
.df-testa .ibtn + .ibtn { margin-left: 0; }

/* 21/11/2026: fumetto dei bottoni con la sola icona (app.js) */
.tip { position: fixed; z-index: 10000; pointer-events: none; max-width: 260px; padding: 5px 9px; border-radius: 7px; background: var(--ink); color: var(--card);
  font-size: 12px; font-weight: 600; line-height: 1.3; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }

/* 21/11/2026: riquadro "Come va" nella scheda lead */
.cvl { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; border-left: 4px solid var(--line); }
.cvl.rosso { border-left-color: var(--red); }
.cvl-t { margin-top: 2px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cvl.rosso .cvl-t { color: var(--red); font-weight: 600; }

/* 21/11/2026: note passate sotto il popup della nota */
.np-lista { margin-top: 18px; }
.np { padding: 8px 0; border-bottom: 1px solid var(--line); }
.np.cv { border-left: 3px solid var(--blue); padding-left: 9px; }
.np-t { white-space: pre-wrap; margin-top: 2px; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.np-t.aperta { display: block; }

/* 21/11/2026: popup d'entrata del Come va (js/entrata.js) */
.cvp { text-align: center; }
.cvp p { margin: 0 0 10px; line-height: 1.45; }
.cvp-ic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cvp-ic svg { width: 24px; height: 24px; }
.cvp-b { display: grid; gap: 8px; margin-top: 16px; }
