:root, :root[data-theme="dark"] {
  --bg: #131518; --panel: #1A1D22; --panel2: #22262C; --line: #2A2F35; --line2: #343A42;
  --text: #E7E5E0; --muted: #A3A9B1; --dim: #8A919A; --faint: #5C636B;
  --accent: #6EA8FE; --accent-hover: #8BB9FF; --accent-ink: #0E1520; --accent-soft: rgba(110,168,254,0.12); --link: #8FB8FF;
  --info-bg: #1F2A3A; --ok: #4CB782; --warn: #E3B341; --crit: #EF6B5B;
  --crit-bg: #2A1E1D; --warn-bg: #2A2619; --we: #15181C; --hol: rgba(239,107,91,0.16);
  --seg: #1F2328; --seg-on: #343A42; --btn-hover: #22262C; --top-bg: rgba(19,21,24,0.96);
  --badge: #C9CDD2; --badge-ink: #131518; --today: #F1EFEA; --today-ink: #131518;
  --st-received: #7FD3A4; --st-received-ink: #0F2A1C; --st-late: #F2A196; --st-late-ink: #3A0D08;
  --st-soon: #A9C6F5; --st-soon-ink: #0E1520; --st-exp: #343A42; --st-exp-ink: #E7E5E0;
  --ghost: #AEB4BB; --lbl: #D5DCE6; --lbl-late: #FFB4A9; --lost: #3A4048; --change: #C792EA; --mix-ink: #0E1520;
  --hot-bg: rgba(239,107,91,0.09); --hot-line: rgba(239,107,91,.55); --hot-tag-bg: #3A2220; --hot-tag-ink: #FFB4A9;
  --danger-line: #5A2C28; --danger-ink: #FFB4A9;
  --chip-owner: #C9B6F2; --chip-editor: #A9C6F5; --chip-viewer: #C9CDD2; --chip-ink: #131518;
  --shadow: rgba(0,0,0,.45);
  --mono: 'IBM Plex Mono', ui-monospace, monospace; --sans: 'IBM Plex Sans', system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F3F2EF; --panel: #FFFFFF; --panel2: #F3F1ED; --line: #E6E3DD; --line2: #D5D1CA;
  --text: #1A1C20; --muted: #555B63; --dim: #6B7178; --faint: #9AA0A7;
  --accent: #2F6FE0; --accent-hover: #2560CA; --accent-ink: #FFFFFF; --accent-soft: rgba(47,111,224,0.10); --link: #2560CA;
  --info-bg: #E8F0FC; --ok: #23845A; --warn: #A86B00; --crit: #C2412F;
  --crit-bg: #FBE7E3; --warn-bg: #FBF1DC; --we: #F4F2EE; --hol: rgba(194,65,47,0.10);
  --seg: #ECEAE5; --seg-on: #FFFFFF; --btn-hover: #F3F1ED; --top-bg: rgba(243,242,239,0.96);
  --badge: #E8E6E2; --badge-ink: #1A1C20; --today: #1A1C20; --today-ink: #FFFFFF;
  --st-received: #D3EFDF; --st-received-ink: #165C3E; --st-late: #F8D3CC; --st-late-ink: #8A2516;
  --st-soon: #DCE8FB; --st-soon-ink: #1D4CA3; --st-exp: #ECEAE5; --st-exp-ink: #1A1C20;
  --ghost: #8A9097; --lbl: #2B3038; --lbl-late: #B5321F; --lost: #C9C5BE; --change: #8B5CC9; --mix-ink: #FFFFFF;
  --hot-bg: rgba(194,65,47,0.06); --hot-line: rgba(194,65,47,.45); --hot-tag-bg: #FBE7E3; --hot-tag-ink: #9C2F1E;
  --danger-line: #E9B8AF; --danger-ink: #A8331F;
  --chip-owner: #E4DAF8; --chip-editor: #DCE8FB; --chip-viewer: #E8E6E2; --chip-ink: #1A1C20;
  --shadow: rgba(30,30,30,.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }
a { color: var(--link); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; }
textarea { width: 100%; min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.hidden { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--top-bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1600px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 24px; }
.brand { font-family: var(--mono); font-size: 13px; letter-spacing: .2em; color: var(--text); text-decoration: none; font-weight: 600; margin-right: 6px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.nav a.on { background: var(--seg-on); color: var(--text); }
.nav a:hover { color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.check { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--chip-ink); background: var(--chip-editor); flex: none; }
.avatar.big { width: 32px; height: 32px; font-size: 12px; }
.acct { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: transparent; color: var(--text); font-weight: 500; font-size: 13px; padding: 4px 10px 4px 4px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.wrap { max-width: 1600px; margin: 0 auto; padding: 22px 24px 60px; display: flex; flex-direction: column; gap: 18px; }
.bottom-nav { display: none; }

.btn { border: 1px solid var(--line2); background: transparent; border-radius: 8px; padding: 9px 14px; font-weight: 500; min-height: 38px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--btn-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.small { padding: 5px 10px; min-height: 30px; font-size: 13px; }
.btn.danger { border-color: var(--danger-line); color: var(--danger-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: var(--seg); border-radius: 8px; padding: 3px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 6px; text-decoration: none; font-weight: 500; font-size: 13px; }
.seg .on { background: var(--seg-on); color: var(--text); }

h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.panel { background: var(--panel); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-h .muted { font-size: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--panel2); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.card .who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.card .what { font-size: 14px; line-height: 1.45; }
.strike { text-decoration: line-through; color: var(--dim); }
.alert { display: flex; gap: 12px; padding: 11px 14px; border-radius: 8px; background: var(--panel2); font-size: 14px; line-height: 1.45; align-items: flex-start; }
.alert .bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.alert.crit { background: var(--crit-bg); } .alert.crit .bar { background: var(--crit); }
.alert.warn { background: var(--warn-bg); } .alert.warn .bar { background: var(--warn); }
.alert.info { background: var(--info-bg); } .alert.info .bar { background: var(--accent); }
.alert.ok { background: var(--info-bg); } .alert.ok .bar { background: var(--ok); }
.empty-cal { gap: 12px; padding: 28px; } .empty-cal p { margin: 0; max-width: 62ch; line-height: 1.5; }
.alert .body { flex: 1; min-width: 0; }
.alert .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.alert .wz-deptdate { margin-top: 6px; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 14px; background: var(--info-bg); border-radius: 10px; padding: 12px 16px; flex-wrap: wrap; }
.banner .tag { font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent); padding: 3px 8px; border-radius: 4px; }
.banner .txt { flex: 1; min-width: 220px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

.badge { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--badge-ink); background: var(--badge); padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.state { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.st-received { color: var(--st-received-ink); background: var(--st-received); }
.st-late { color: var(--st-late-ink); background: var(--st-late); }
.st-soon { color: var(--st-soon-ink); background: var(--st-soon); }
.st-expected { color: var(--st-exp-ink); background: var(--st-exp); }
.role { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 4px; color: var(--chip-ink); }
.role-owner { background: var(--chip-owner); } .role-editor { background: var(--chip-editor); } .role-viewer { background: var(--chip-viewer); }

.list-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.list-row:first-of-type { border-top: 0; }
.agenda-day { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.agenda-day .d { width: 64px; flex: none; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.agenda-day .d b { display: block; font-size: 18px; font-weight: 500; color: var(--text); }
.agenda-day .items { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.agenda-item { display: flex; align-items: center; gap: 8px; font-size: 14px; background: none; border: 0; padding: 0; text-align: left; width: 100%; color: var(--text); min-height: 28px; }
.agenda-item span.t { flex: 1; min-width: 0; }

/* timeline */
.tl { position: relative; background: var(--panel); border-radius: 12px; overflow: hidden; }
.tl-labels { position: absolute; left: 0; top: 0; z-index: 3; background: var(--panel); border-right: 1px solid var(--line); }
.tl-scroll { overflow-x: auto; overflow-y: hidden; }
.tl-canvas { position: relative; overflow: hidden; }
.tl-canvas > *, .tl-labels > * { position: absolute; }
.tl-day { top: 0; bottom: 0; }
.tl-wk { z-index: 1; top: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-dn { top: 27px; text-align: center; font-family: var(--mono); font-size: 9px; color: var(--dim); }
.tl-hline { left: 0; right: 0; height: 1px; background: var(--line); }
.tl-today { top: 40px; bottom: 0; width: 2px; background: var(--today); z-index: 2; }
.tl-todaytag { top: 4px; font-size: 10px; font-weight: 600; background: var(--today); color: var(--today-ink); padding: 1px 6px; border-radius: 3px; z-index: 2; }
.tl-hot { top: 44px; bottom: 0; background: var(--hot-bg); border-left: 1px dashed var(--hot-line); border-right: 1px dashed var(--hot-line); }
.tl-hottag { bottom: 8px; font-size: 11px; font-weight: 600; color: var(--hot-tag-ink); background: var(--hot-tag-bg); padding: 3px 7px; border-radius: 4px; white-space: nowrap; z-index: 2; }
.tl-lane { left: 16px; display: flex; flex-direction: column; gap: 2px; width: 150px; }
.tl-lane a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.tl-lane a:hover { text-decoration: underline; }
.tl-lane .m { font-size: 11px; color: var(--dim); padding-left: 17px; }
.tl-ul { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ul.big { text-align: left; font-size: 17px; color: var(--text); font-weight: 500; overflow: visible; }
.tl-ul.big small { display: block; font-family: var(--sans); font-size: 11px; color: var(--dim); font-weight: 400; margin-top: 3px; }
.ev { border: 0; padding: 0; margin: 0; background: none; z-index: 1; }
.ev:hover { filter: brightness(1.15); z-index: 4; }
.ev-lock { transform: rotate(45deg); }
.ev-blk { border-radius: 3px; font-family: var(--mono); font-weight: 600; overflow: hidden; white-space: nowrap; text-align: left; box-sizing: border-box; }
.ev-week { border-style: dashed !important; }
.ev-chg { border-radius: 50%; }
.ev-lbl { font-family: var(--mono); font-size: calc(11px * var(--tls, 1)); color: var(--lbl); white-space: nowrap; pointer-events: none; }
.ev-lbl.late { color: var(--lbl-late); }
.win { border-radius: 3px; }
.win-lbl { font-size: calc(12px * var(--tls, 1)); font-weight: 600; white-space: nowrap; text-align: center; pointer-events: none; }
.ghost { border: 1px dashed var(--ghost); border-radius: 3px; pointer-events: none; }
.ghost-lbl { font-family: var(--mono); font-size: 10px; color: var(--dim); text-decoration: line-through; white-space: nowrap; pointer-events: none; }
.ghost-arrow { height: 0; border-top: 1px dashed var(--ghost); pointer-events: none; }
/* Nota del calendario (v2.9.1): linea grigia tratteggiata con fumetto all'inizio, si apre con un clic */
.note-mark { position: absolute; height: 20px; min-width: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: block; }
.note-mark::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; border-top: 2px dashed var(--muted); opacity: .7; }
.note-mark .nb { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 4px; background: var(--panel); display: flex; align-items: center; justify-content: center; color: var(--text); }
.note-mark:hover::before, .note-mark:focus-visible::before { opacity: 1; border-top-color: var(--text); }
.lg-note { position: relative; width: 26px; height: 14px; display: inline-block; color: var(--text); }
.lg-note::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; border-top: 2px dashed var(--muted); }
.lg-note .nb { position: absolute; left: 0; top: 0; width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; background: var(--panel); border-radius: 4px; }
.note-ico { display: inline-flex; vertical-align: -1px; color: var(--muted); }
.note-text { font-size: 16px; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel2); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--muted); align-items: center; }
.legend span.i { display: inline-flex; align-items: center; gap: 7px; }
.lg { background: var(--badge); }
.tl-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* forms, wizard */
.steps { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.steps span { padding: 6px 10px; border-radius: 6px; background: var(--panel2); color: var(--dim); }
.steps span.on { background: var(--seg-on); color: var(--text); font-weight: 500; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line2); background: transparent; border-radius: 8px; padding: 10px 12px; color: var(--text); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt .r { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); flex: none; }
.opt.on .r { border-color: var(--accent); background: var(--accent); }
.cat-dept { display: flex; gap: 16px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
.cat-dept .dn { width: 150px; flex: none; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 6px; overflow-wrap: anywhere; }
.cat-items { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; flex-wrap: wrap; }
.cat-item.on { background: var(--accent-soft); }
.cat-item label { flex: 1; display: flex; gap: 10px; align-items: baseline; cursor: pointer; min-width: 0; }
.cat-item .c { font-family: var(--mono); font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.cat-item .d { color: var(--muted); font-size: 12px; }
.cat-item .n { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.cat-item select { padding: 4px 6px; font-size: 12px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); }
.tag3 { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 3px 8px; border-radius: 4px; color: var(--chip-ink); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }
.help { background: var(--info-bg); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.help ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.codebox { font-family: var(--mono); font-size: 13px; background: var(--panel); border: 1px solid var(--line2); padding: 7px 10px; border-radius: 6px; word-break: break-all; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .nm { display: flex; flex-direction: column; min-width: 0; }
.person .nm b { font-weight: 500; font-size: 14px; }
.person .nm span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gstat { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.gstat i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; padding: 22px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line2); box-shadow: 0 10px 40px var(--shadow); }
.modal .x { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--today); color: var(--today-ink); padding: 10px 16px; border-radius: 8px; font-weight: 500; z-index: 60; box-shadow: 0 6px 24px var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--st-late); color: var(--st-late-ink); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.welcome { max-width: 760px; margin: 40px auto; display: flex; flex-direction: column; gap: 18px; }
.welcome p { color: var(--muted); line-height: 1.6; font-size: 15px; margin: 0; }
.auth { max-width: 420px; margin: 56px auto; display: flex; flex-direction: column; gap: 16px; }
.auth .panel { padding: 28px; gap: 16px; }
.auth input { font-size: 15px; padding: 11px 12px; }
.reels { display: flex; gap: 6px; flex-wrap: wrap; }
.reel { border: 1px solid var(--line2); background: transparent; border-radius: 6px; padding: 6px 10px; font-family: var(--mono); font-size: 12px; color: var(--text); }
.reel.on { background: var(--st-received); color: var(--st-received-ink); border-color: var(--st-received); font-weight: 600; }
details summary { cursor: pointer; font-weight: 600; }

/* tablet and touch */
@media (pointer: coarse) {
  .btn { min-height: 44px; } .btn.small { min-height: 38px; }
  .seg a, .seg button { padding: 10px 14px; }
}
/* phone */
@media (max-width: 760px) {
  .wrap { padding: 16px 14px 96px; }
  .top-in { padding: 8px 14px; gap: 10px; }
  .top .nav, .top .acct, .top .check { display: none; }
  .head [data-act="sync-all"] { display: none; }
  .head .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; } .head .seg > * { white-space: nowrap; }
  .tl-ul.big small { display: none; }
  .tl-ul.big { font-size: 13px; left: 8px !important; width: 60px !important; overflow: hidden; text-overflow: ellipsis; }
  .top .spacer { flex: 1; }
  h1 { font-size: 22px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; text-decoration: none; color: var(--muted); font-size: 11px; }
  .bottom-nav a.on { color: var(--accent); font-weight: 600; }
  .cat-dept { flex-direction: column; gap: 6px; }
  .kv { grid-template-columns: 1fr; }
  .toast { bottom: 84px; }
}

/* members and invites: fixed columns */
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 128px 250px 76px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mrow .person { min-width: 0; } .mrow .nm { min-width: 0; } .mrow .nm b, .mrow .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrole select { width: 100%; }
.mstat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mcheck { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mact { display: flex; justify-content: flex-end; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.irow { display: grid; grid-template-columns: minmax(0, 1fr) 128px 90px 236px; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.iemail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iact { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 760px) {
  .mrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .mrow .person { grid-column: 1 / 2; } .mrow .mact { grid-column: 2; grid-row: 1; }
  .mrow .mrole { grid-column: 1 / 3; max-width: 160px; } .mrow .mstat { grid-column: 1 / 3; }
  .irow { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 8px; }
  .irow .iact { grid-column: 1 / 4; justify-content: flex-start; }
}

/* v2.1: zoom, assignments, my days, simulation, log */
.seg .zoom-ind { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.seg .zoom-ind i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.seg .zoom-ind:disabled { cursor: default; }
.seg .zoom-ind.lit { color: var(--accent); background: var(--panel); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }
.seg .zoom-ind.lit i { opacity: 1; }
.seg-sep { width: 1px; background: var(--line2); margin: 4px 3px; align-self: stretch; }
.tl-scroll { cursor: grab; }
.tl-scroll.dragging { cursor: grabbing; }
.tl-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl-av { width: 18px; height: 18px; border-radius: 50%; background: var(--chip-editor); color: var(--chip-ink); font-size: 8px; font-weight: 600; display: flex; align-items: center; justify-content: center; transform: translateX(-100%); margin-left: -2px; }
.tl.tl-sim { outline: 2px dashed var(--warn); outline-offset: 2px; }
.sim-drag { cursor: ew-resize !important; }
.sim-moved { outline: 2px solid var(--warn); outline-offset: 1px; }
.sim-ghost { border: 1px dashed var(--muted); border-radius: 3px; opacity: .6; pointer-events: none; }
.sim-btn { width: 104px; color: var(--warn); border-color: var(--warn); }
.tg-sim { width: 104px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; font-weight: 600; color: var(--bg); background: var(--warn); border-radius: 7px; padding: 6px 0; line-height: 16px; }
.simbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px solid var(--warn); border-radius: 10px; padding: 10px 14px; background: color-mix(in srgb, var(--warn) 7%, transparent); }
.simbar .tg-sim { width: auto; padding: 4px 8px; }
.simchg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13px; }
.simchg .mono { font-size: 12px; }
.strike { text-decoration: line-through; color: var(--dim); }
.sim-summary { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; line-height: 1.5; }
.log-tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 500; flex: none; }
.log-tag.sheet { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.log-tag.people { background: color-mix(in srgb, var(--change) 18%, transparent); color: var(--change); }
.grid-m { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
.members-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.side-m { border-left: 1px solid var(--line); padding-left: 24px; min-width: 0; }
.sub-block { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.sub-block h2 { font-size: 15px; }
.grid-assign { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.agrid { display: grid; grid-template-columns: 90px repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.agrid > div { padding: 9px 8px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; min-width: 0; }
.ahd { justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 500; }
.aep { font-size: 13px; }
.acell-wrap { position: relative; }
.acell { border: 1px dashed var(--line2); background: transparent; color: var(--dim); font: inherit; font-size: 13px; border-radius: 18px; padding: 3px 11px 3px 3px; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; cursor: pointer; }
.acell:disabled { cursor: default; }
.acell.set { border-style: solid; border-color: var(--line); background: var(--panel2); color: var(--text); }
.acell.me { border-color: var(--accent); }
.acell .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.empty { background: transparent; border: 1px dashed var(--line2); color: var(--dim); }
.amenu { position: absolute; top: calc(100% - 2px); left: 8px; z-index: 30; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.28); padding: 5px; min-width: 200px; display: flex; flex-direction: column; }
.amenu button, .amenu a { border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; padding: 7px 9px; border-radius: 6px; display: flex; gap: 8px; align-items: center; cursor: pointer; text-decoration: none; }
.amenu button:hover, .amenu a:hover { background: var(--panel2); }
.amenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.acell .nm.none, .amenu .none { color: var(--dim); }
.acell.none { border-color: var(--line); }
.acell .nm.asedit { color: var(--muted); }
.avatar.faint { opacity: .5; }
.amenu button.on { background: var(--panel2); font-weight: 600; }
.del-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; }
.del-list .row { gap: 8px; font-size: 13px; }
.acct-wrap { position: relative; }
.acct { font: inherit; cursor: pointer; }
.acct-menu { left: auto; right: 0; top: calc(100% + 6px); min-width: 170px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: 12px; cursor: pointer; }
.loadrow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tagbox { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.month h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mgrid .dh { font-family: var(--mono); font-size: 10px; color: var(--dim); text-align: center; }
.dcell { border: 1px solid transparent; background: var(--panel2); color: var(--text); font: inherit; font-family: var(--mono); font-size: 12px; border-radius: 6px; aspect-ratio: 1.25; cursor: pointer; position: relative; display: flex; align-items: flex-start; padding: 4px 5px; min-width: 0; }
.dcell.we { background: transparent; color: var(--faint); border-color: var(--line); }
.dcell.off { background: color-mix(in srgb, var(--crit) 16%, transparent); color: var(--crit); border-color: var(--crit); }
.dcell.extra { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); border-color: var(--ok); }
.dcell.td { box-shadow: inset 0 0 0 2px var(--text); }
.dcell.commit::after { content: ''; position: absolute; left: 5px; right: 5px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--change); }
.dcell.commit.half::after { right: 50%; }
.pill { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 500; }
.pill.off { background: color-mix(in srgb, var(--crit) 16%, transparent); color: var(--crit); }
.pill.extra { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.commit { background: color-mix(in srgb, var(--change) 18%, transparent); color: var(--change); }
.lg-off, .lg-extra { width: 12px; height: 12px; border-radius: 3px; }
.lg-off { background: color-mix(in srgb, var(--crit) 16%, transparent); border: 1px solid var(--crit); }
.lg-extra { background: color-mix(in srgb, var(--ok) 18%, transparent); border: 1px solid var(--ok); }
.lg-com { width: 16px; height: 3px; background: var(--change); }
@media (max-width: 1100px) { .grid-m, .grid-assign { grid-template-columns: minmax(0, 1fr); } .side-m { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 760px) {
  .months { grid-template-columns: minmax(0, 1fr); }
  .agrid { grid-template-columns: 52px repeat(3, minmax(0, 1fr)); }
  .loadrow { grid-template-columns: minmax(0, 1fr); }
  .acct-wrap { display: none; }
}
@media (max-width: 760px) { .head > div, .head .row { min-width: 0; max-width: 100%; } .head .row .seg { flex: 1 1 auto; min-width: 0; } }
.tl-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-bar .tl-nav, .head .tl-nav { justify-content: flex-end; margin-left: auto; }
/* v2.1.8 · people colours, three-way scope, hidden projects */
:root { --u0: #F2C14E; --u1: #F78C6B; --u2: #7FD8BE; --u3: #E79CD8; --u4: #8EC5FF; --u5: #C3A6FF; --u6: #B5E07A; --u7: #FFB570; --u8: #7DD3E8; --u9: #E8A8A8; }
.avatar.sm { width: 20px; height: 20px; font-size: 8.5px; }
.tl-av { color: var(--chip-ink); }
.tl-mav { position: absolute; border-radius: 50%; color: var(--chip-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 2; }
.tl-ulrow { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.person .nm b.me { font-weight: 700; }
.hidden-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); background: var(--panel2); border: 1px dashed var(--line2); border-radius: 10px; padding: 10px 14px; }
.hidden-note a { text-decoration: none; }
.seg.scope .on { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
@media (max-width: 760px) { .tl-ul.big .tl-ulrow .avatar { display: none; } }
/* admin users: fixed columns so every row lines up */
.urow, .uirow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) 90px 200px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.urow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) 90px 190px 74px; }
.urow .udel { justify-self: end; }
.panel > .urow:first-child { border-top: 0; }
.urow .person, .urow .nm { min-width: 0; } .urow .nm b, .urow .nm span, .uirow .iemail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uprojs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.useen { font-size: 13px; }
.uirow .iact { display: flex; justify-content: flex-end; }
@media (max-width: 760px) { .urow, .uirow { grid-template-columns: minmax(0, 1fr); gap: 8px; } .uirow .iact { justify-content: flex-start; } }
/* timeline lane label: never overlaps the episode names */
.tl-lane a, .tl-lane .m { min-width: 0; } .tl-lane .nm, .tl-lane .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-lane .dot { flex: none; }
.tl-lane.stack a { font-size: 13px; }
/* phone: timeline controls on tidy full-width rows */
@media (max-width: 760px) {
  .head .tl-nav, .tl-bar .tl-nav { width: 100%; margin-left: 0; justify-content: flex-start; }
  .tl-nav > .seg { flex: 1 1 100%; flex-wrap: nowrap; overflow: visible; }
  .tl-nav > .seg > button { flex: 1 1 0; padding-left: 4px; padding-right: 4px; white-space: nowrap; text-align: center; justify-content: center; }
  .tl-nav > .seg .seg-sep { display: none; }
  .tl-nav .btn.small { min-width: 40px; }
  .tl-nav .sim-btn, .tl-nav .tg-sim { flex: 1 1 auto; width: auto; }
}
/* top bar "More" menu */
.nav { overflow: visible; }
.nav-more { position: relative; display: flex; }
.nav-more.hidden { display: none; }
.nav-mbtn { white-space: nowrap; border: 0; background: transparent; color: var(--muted); padding: 8px 12px; border-radius: 6px; font: inherit; }
.nav-mbtn:hover { color: var(--text); } .nav-mbtn.on { background: var(--seg-on); color: var(--text); }
.nav-menu { top: calc(100% + 6px); left: 0; min-width: 210px; }
.nav-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav-menu a:hover { background: var(--panel2); }
.nav-menu a.hidden, .top .check.hidden, .nav a.hidden { display: none; }
.top-in.compact .lbl { display: none; }
/* v2.2 · editing pace */
:root, :root[data-theme="dark"] { --myoff: rgba(199,146,234,.14); --rt-ovl: rgba(227,179,65,.16); }
:root[data-theme="light"] { --myoff: rgba(139,92,201,.10); --rt-ovl: rgba(168,107,0,.10); }
.tab-badge { display: inline-block; margin-left: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; font-size: 10.5px; font-weight: 700; padding: 0 5px; line-height: 16px; }
.ritmo { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 9px; background: var(--panel2); border-left: 3px solid var(--ok); text-decoration: none; color: var(--text); flex-wrap: wrap; }
.ritmo:hover { background: var(--btn-hover); }
.ritmo .rt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ritmo .muted { font-size: 12px; } .ritmo .go { color: var(--link); font-size: 12.5px; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi span { font-size: 12px; color: var(--muted); } .kpi b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; } .kpi b .u { font-size: 13px; font-weight: 400; color: var(--muted); } .kpi small { font-size: 11.5px; color: var(--dim); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rt-table { overflow-x: auto; }
.rt-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rt-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rt-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.rt-ep { display: inline-flex; gap: 7px; align-items: center; color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.rt-in { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.rt-num { width: 66px; text-align: right; padding: 5px 8px; }
.rt-src { display: block; font-size: 11px; color: var(--dim); margin-top: 3px; }
.rt-prog { width: 70px; height: 5px; border-radius: 3px; background: var(--line2); overflow: hidden; display: inline-block; } .rt-prog i { display: block; height: 100%; background: var(--accent); }
.rt-set { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; }
.rt-bar { position: absolute; height: 14px; border-radius: 4px; border: 1px solid; overflow: hidden; }
.rt-blbl { font-family: var(--mono); font-size: calc(11px * var(--tls, 1)); font-weight: 600; color: var(--mix-ink); padding-left: 5px; line-height: 13px; white-space: nowrap; }
.rt-mix { position: absolute; height: 18px; border-radius: 3px; background: var(--line2); color: var(--text); font-family: var(--mono); font-size: calc(11px * var(--tls, 1)); font-weight: 600; padding-left: 4px; line-height: 18px; overflow: hidden; }
.rt-ovl { position: absolute; bottom: 0; background: var(--rt-ovl); border-left: 1px dashed var(--warn); border-right: 1px dashed var(--warn); }
.rt-neck { position: absolute; bottom: 0; border: 1px solid var(--crit); background: rgba(239,107,91,.05); border-radius: 3px; }
.rt-necktag { position: absolute; font-size: calc(12px * var(--tls, 1)); color: var(--crit); white-space: nowrap; font-weight: 500; }
.hint { font-size: 12px; color: var(--dim); line-height: 1.45; }
.rt-set .field { min-width: 0; max-width: 100%; } .rt-set select { max-width: 100%; }
.rt-blbl { line-height: calc(12px * var(--tls, 1)); display: block; }
/* v2.2 · simulation of the pace */
.pace { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: baseline; background: var(--panel2); border-radius: 10px; padding: 12px 14px; border-left: 3px solid var(--ok); }
.pace > span { color: var(--muted); font-size: 12.5px; } .pace > b { font-size: 15px; font-variant-numeric: tabular-nums; }
.was { opacity: .5; font-weight: 400; margin-right: 6px; }
.kpi .was { font-size: 15px; }
.rt-mix.sim-drag { cursor: ew-resize; outline: 1px dashed var(--warn); outline-offset: 1px; touch-action: none; }
.rt-ghost { position: absolute; height: 18px; border: 1px dashed var(--faint); border-radius: 3px; }
.rt-handle { position: absolute; width: 8px; height: 22px; border-radius: 3px; background: var(--warn); cursor: ew-resize; touch-action: none; z-index: 2; }
:root, :root[data-theme="dark"] { --mixbusy: rgba(110,168,254,.13); }
:root[data-theme="light"] { --mixbusy: rgba(47,111,224,.09); }
/* v3.4.1 · Ritmo: giorni di Mix e ADR a righe, Altri impegni, Disponibilità */
:root, :root[data-theme="dark"] { --mixhatch: rgba(110,168,254,.30); --mixhatch2: rgba(110,168,254,.10); --mycol: #C792EA; --myextra: #5BC0A0; }
:root[data-theme="light"] { --mixhatch: rgba(47,111,224,.26); --mixhatch2: rgba(47,111,224,.07); --mycol: #8B5CC9; --myextra: #1F8A68; }
.tl-day.rt-busy, .rt-busy-lg { background: repeating-linear-gradient(135deg, var(--mixhatch) 0 5px, var(--mixhatch2) 5px 10px); }
.rt-blk { position: absolute; display: block; box-sizing: border-box; margin: 0; padding: 0 0 0 5px; border: 1px solid var(--faint); border-radius: 3px; background: var(--panel2); color: var(--text); font: 600 calc(11px * var(--tls, 1)) var(--mono); text-align: left; text-decoration: none; white-space: nowrap; overflow: hidden; cursor: pointer; }
.rt-blk.rt-my { overflow: visible; color: var(--text); border-color: var(--mycol); background: color-mix(in srgb, var(--mycol) 22%, transparent); }
.rt-blk.rt-my-off { background: color-mix(in srgb, var(--mycol) 40%, transparent); }
.rt-blk.rt-my-half { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--mycol) 40%, transparent) 0 4px, transparent 4px 8px); }
.rt-blk.rt-my-extra { border-color: var(--myextra); background: color-mix(in srgb, var(--myextra) 18%, transparent); }
.rt-blk:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rt-mix.mine { color: var(--mix-ink); }
.rt-grp { position: absolute; left: 16px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
/* v2.3 · invites inside the app */
.invite-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; }
.invite-banner .ib-txt { flex: 1; min-width: 200px; line-height: 1.45; }
.invite-banner .ib-txt small { display: block; color: var(--muted); font-size: 12px; }
.iv-check { margin-top: 10px; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.iv-check.yes { background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.iv-check.no { background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); }
/* v2.3 · invite picker */
.iv-field { position: relative; }
.iv-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 12px 30px var(--shadow); padding: 6px; z-index: 25; max-height: 320px; overflow: auto; }
.iv-grp { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 8px 8px 4px; }
.iv-opt { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.iv-opt:hover, .iv-opt.hl { background: var(--panel2); }
.iv-opt .nm, .iv-chosen .nm { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.iv-opt .nm b, .iv-chosen .nm b { font-weight: 500; font-size: 13.5px; }
.iv-opt .nm span, .iv-chosen .nm span { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-opt mark { background: var(--accent-soft); color: inherit; border-radius: 2px; }
.iv-empty { padding: 10px 8px; color: var(--dim); font-size: 13px; }
.iv-chosen { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--accent); border-radius: 7px; padding: 4px 4px 4px 4px; }
.iv-chosen .x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 8px; }
.btn.iv-send { width: 132px; justify-content: center; text-align: center; white-space: nowrap; }

/* availability: months to scroll and periods */
.md-nav { display: flex; gap: 6px; align-items: center; }
.md-nav .btn { position: relative; min-width: 34px; }
.md-nav .pip { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.md-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.md-dates input { width: 100%; }
.dcell.commit:not(.off):not(.extra) { background: color-mix(in srgb, var(--change) 14%, transparent); }
.dcell.rs { border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
.dcell.re { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.dcell.rm { border-radius: 2px; }

/* personal days on the timelines (visible only to the person) */
:root, :root[data-theme="dark"] { --mypurple: #C792EA; }
:root[data-theme="light"] { --mypurple: #8B5CC9; }
.tl-my { background: var(--myoff); pointer-events: none; }
.tl-my.half { background: repeating-linear-gradient(135deg, var(--myoff) 0 4px, transparent 4px 8px); }
.tl-mystrip { height: 4px; border-radius: 2px; background: var(--mypurple); z-index: 2; }
.tl-mystrip.half { background: linear-gradient(90deg, var(--mypurple) 50%, transparent 50%); }
.toast-act { margin-left: 10px; background: transparent; border: 1px solid currentColor; color: inherit; font: inherit; font-weight: 600; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
/* Episodes followed (v2.7) */
.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.modal .ep-list { grid-template-columns: 1fr; max-height: 52vh; overflow-y: auto; }
.ep-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-width: 0; }
.ep-row.on { border-color: var(--accent); background: var(--accent-soft); }
.ep-row.empty .ep-i { color: var(--dim); }
.ep-n { font-weight: 600; font-size: 14px; min-width: 34px; }
.ep-i { flex: 1; font-size: 13px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-codes { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; border: 1px solid var(--line2); color: var(--dim); }
.card.ask { box-shadow: inset 3px 0 0 var(--st-soon); }
.card.ask .acts { margin-top: 6px; gap: 8px; }
@media (max-width: 760px) { .ep-list { grid-template-columns: 1fr; } }
.rcv-opts { display: flex; flex-direction: column; gap: 6px; }
.rcv-opts .opt { padding: 8px 12px; }

/* v2.8 mail precompilate */
.mail-set .mail-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.mail-set .mail-row label { font-weight: 500; color: var(--muted); font-size: 13px; }
.mail-box { border-top: 1px solid var(--line2); padding-top: 12px; }
.mail-box .kv { grid-template-columns: 40px 1fr; font-size: 13px; word-break: break-word; }
.mail-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.tpl-block { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line2); }
.tpl-block h3 { margin: 0; font-size: 15px; font-weight: 600; }
@media (max-width: 520px) { .mail-set .mail-row { grid-template-columns: 1fr; gap: 4px; } }

/* Disponibilità: modifica di un periodo (v2.9) */
.btn.icon { padding: 5px 8px; display: inline-flex; align-items: center; justify-content: center; }
.btn .pen { vertical-align: -2px; }
.panel.md-edit { box-shadow: inset 3px 0 0 var(--accent); }
.list-row.md-editing { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.dcell.md-sel { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Maintenance (v3.0) */
.mt-tabs, .mt-filter .seg { align-self: flex-start; }
.mt-badge { background: var(--line2); color: var(--text); }
.mt-filter { justify-content: space-between; }
.mprow { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr) 110px 120px 100px 90px 120px; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mphead { border-top: 0; padding-top: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.mp-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; } .mp-name b { font-weight: 600; }
.mp-owner { display: flex; align-items: center; gap: 8px; min-width: 0; } .mp-owner > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-mem { display: flex; } .mp-mem .avatar + .avatar { margin-left: -3px; box-shadow: 0 0 0 2px var(--panel); }
.mp-act, .mp-hist { font-size: 13px; }
.mp-acts { display: flex; gap: 6px; justify-content: flex-end; }
.mp-mw { position: relative; }
.amenu.mp-menu { right: 0; left: auto; top: calc(100% + 4px); min-width: 210px; position: absolute; z-index: 20; }
.danger-ink { color: var(--danger-ink); }
.mt-pill { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line2); font-weight: 400; }
.mt-pill.ripe { color: var(--text); background: var(--line); }
.mc-grid { display: grid; gap: 16px; }
.mc { gap: 12px; }
.mc-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; } .mc-h h2 { margin: 0 0 4px; } .mc-h .muted { font-size: 13px; line-height: 1.5; max-width: 62ch; }
.mc-n { text-align: right; flex: none; } .mc-n b { display: block; font-size: 26px; font-weight: 600; line-height: 1; } .mc-n span { font-size: 12px; color: var(--dim); }
.mc-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); font-size: 14px; }
.mc-list .row { gap: 8px; flex-wrap: wrap; } .mc-k { font-weight: 600; min-width: 28px; }
.mc-wait { opacity: .7; }
.du-list { display: flex; flex-direction: column; gap: 8px; }
.du-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.du-row .seg button { padding: 5px 10px; }
@media (max-width: 760px) {
  .mphead { display: none; } .mphead + .mprow { border-top: 0; }
  .mprow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .mprow .mp-name, .mprow .mp-act, .mprow .mp-acts { grid-column: 1 / -1; }
  .mprow .mp-mem, .mprow .mp-hist { display: none; }
  .mprow .mp-ev::before, .mprow .mp-act::before { content: attr(data-l) ' '; color: var(--dim); }
  .mprow .mp-acts { justify-content: flex-start; }
  .mc-h { flex-direction: column; gap: 6px; } .mc-n { text-align: left; } .mc-n b { display: inline; font-size: 20px; margin-right: 6px; }
}
.amenu button:disabled { opacity: .45; cursor: default; background: none; }

/* Installa app (v3.2): pulsante a pillola nella barra in alto; sotto 1180 px solo l'icona, sul telefono di nuovo con la scritta */
.top .inst { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 999px; }
.inst-steps { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
@media (max-width: 1180px) { .top .inst .lbl { display: none; } .top .inst { padding-left: 8px; padding-right: 8px; } }
@media (max-width: 760px) { .top .inst .lbl { display: inline; } }

/* ---------- v3.3: accesso a pagamento ---------- */
.acc { justify-self: end; align-self: center; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; color: var(--chip-ink); white-space: nowrap; }
.acc-trial { background: var(--st-soon); color: var(--st-soon-ink); } .acc-paid { background: var(--st-received); color: var(--st-received-ink); } .acc-beta { background: var(--chip-owner); }
.acc-expired { background: var(--st-late); color: var(--st-late-ink); } .acc-free, .acc-admin { background: transparent; border: 1px solid var(--line2); color: var(--muted); } .acc-admin { color: var(--text); }
.acc-d { font-size: 12px; color: var(--muted); white-space: nowrap; justify-self: end; text-align: right; }
.acc-btn { width: 100%; justify-content: center; }
.acc-ctl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.acc-ctl .k { font-size: 12px; color: var(--dim); }
.acc-ctl .row { gap: 8px; }
.acc-date { width: 160px; }
.acc-sum { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-sum .acc { justify-self: auto; }
.acc-req { background: var(--panel2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: inset 3px 0 0 var(--warn); }
.acc-req .nm { display: flex; flex-direction: column; min-width: 0; } .acc-req .nm span { font-size: 12px; color: var(--dim); }
.acc-msg { font-size: 13px; color: var(--muted); line-height: 1.5; border-left: 2px solid var(--line2); padding-left: 10px; white-space: pre-wrap; }
.acc-acts { justify-content: flex-end; }
.ghostbtn { border-color: transparent; color: var(--dim); }
.acc-grants { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.acc-grants .list-row .acc { justify-self: auto; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.acc-banner.warn { background: var(--warn-bg); border-color: rgba(227,179,65,.45); }
:root[data-theme="light"] .acc-banner.warn { border-color: rgba(168,107,0,.35); }
.acc-bt { background: var(--warn); color: var(--chip-ink); }
.acc-note { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.acc-panel .row { gap: 10px; }
.acc-panel .acc { justify-self: auto; }
.auth-req { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.field .lbl-opt { font-weight: 400; color: var(--dim); }
.iv-warn .acts { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.acc-people .panel-h { flex-wrap: wrap; gap: 10px; }
.urow { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 150px 184px 118px 136px 74px; gap: 12px; }
.urow .useen { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 760px) {
  .urow { grid-template-columns: minmax(0, 1fr) auto; }
  .urow .person, .urow .uprojs, .urow .useen { grid-column: 1 / 3; }
  .urow .acc-d { justify-self: start; text-align: left; } .urow .acc { justify-self: end; }
  .urow .acc-btn { grid-column: 1 / 2; width: auto; justify-self: start; } .urow .udel { grid-column: 2; }
  .acc-ctl { grid-template-columns: 1fr; }
}

/* ---------- v3.3.4: Cosa è cambiato scorrevole ---------- */
.chg-count { color: var(--dim); font-weight: 500; }
.chg-wrap { position: relative; }
.chg-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; overscroll-behavior: contain; }
.chg-list > .card { flex: none; }
.chg-wrap[data-chg="8"] .chg-list { max-height: 690px; }
.chg-wrap[data-chg="5"] .chg-list { max-height: 430px; }
.chg-list::-webkit-scrollbar { width: 8px; } .chg-list::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
.chg-fade { position: absolute; left: 0; right: 6px; bottom: 0; height: 56px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--panel)); transition: opacity .2s; }
.chg-wrap.end .chg-fade { opacity: 0; }
@media (max-width: 760px) { .chg-wrap .chg-list { max-height: 60vh !important; } }

/* v3.6 Tutorial: barra in cima, luce sul punto spiegato, riquadro dei passi, proposta al primo accesso */
.tu-bar { position: relative; z-index: 19; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--accent); font-size: 13px; color: var(--text); flex-wrap: wrap; }
.tu-bar b { letter-spacing: .08em; font-size: 11px; color: var(--accent); }
.tu-bar .sp { flex: 1; }
.tu-ex { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); margin-left: 6px; vertical-align: middle; line-height: 1.3; font-family: inherit; }
h1 .tu-ex { font-size: 12px; vertical-align: 4px; }
#tu-layer .tu-dim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); pointer-events: none; }
#tu-layer .tu-spot { position: fixed; z-index: 71; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); pointer-events: none; }
#tu-layer .tu-spot.tap::after { content: ''; position: absolute; inset: -8px; border: 2px solid var(--accent); border-radius: 16px; opacity: .45; }
#tu-layer .tu-card { position: fixed; z-index: 72; width: 360px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 16px 18px; box-shadow: 0 12px 40px var(--shadow); display: flex; flex-direction: column; gap: 10px; color: var(--text); }
#tu-layer .tu-card.wide { width: 470px; }
#tu-layer .tu-card.paused { right: 16px; bottom: 16px; }
#tu-layer .tu-card .n { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--accent); }
#tu-layer .tu-card h3 { margin: 0; font-size: 17px; }
#tu-layer .tu-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
#tu-layer .tu-card .tap-hint { font-size: 13px; color: var(--text); display: flex; gap: 8px; align-items: center; }
#tu-layer .tu-card .tap-hint i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: none; }
#tu-layer .tu-card .row { display: flex; align-items: center; gap: 8px; }
#tu-layer .tu-card .dots { display: flex; gap: 3px; flex-wrap: wrap; }
#tu-layer .tu-card .dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--line2); }
#tu-layer .tu-card .dots span.on { background: var(--accent); }
#tu-layer .tu-card .lnk { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 4px 0; cursor: pointer; align-self: flex-start; }
#tu-layer .tu-card .lnk:hover { color: var(--text); }
#tu-layer .tu-card.phone { left: 12px; right: 12px; width: auto; max-width: none; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-height: 50vh; overflow-y: auto; }
.modal.tu-offer { max-width: 480px; gap: 12px; }
.modal.tu-offer h2 { margin: 0; font-size: 22px; }
.modal.tu-offer p { margin: 0; line-height: 1.5; }
.modal.tu-offer ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; font-size: 14px; }

/* v3.7: film a rulli */
.rl-line { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; align-items: center; white-space: normal; }
.rl-chip { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 10.5px; color: var(--text); font-weight: 500; }
.rl-chip .avatar { width: 16px; height: 16px; font-size: 7.5px; }
.tl-lane .rl-line { padding-left: 17px; margin-top: 4px; }
/* v3.11.3: colonne tutte uguali (etichetta larga quanto "R20") e mai fuori dal riquadro: tante colonne quante ne entrano */
.cd-reels { display: grid; grid-template-columns: repeat(auto-fill, 118px); gap: 8px 12px; justify-content: start; align-items: center; width: 100%; max-width: 100%; }
.cd-reels .rt-in { min-width: 0; }
.cd-reels .rl-lbl { display: inline-block; width: 3ch; flex: none; margin-right: 0; }
.cd-reels .rt-num { width: 54px !important; }
.rl-lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.film-dur .seg { align-self: flex-start; }


/* v3.8: Workload in primo piano */
.nav-sep { width: 1px; height: 22px; background: var(--line2); margin: 0 8px; flex: none; align-self: center; }
.bottom-nav.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bottom-nav a { min-width: 0; }
.bottom-nav .bl { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 374px) { .bottom-nav a { font-size: 10px; } }
.ritmo.wl-top { margin: 0 0 14px; }

.ev-lbl.ev-sm { font-weight: 600; color: var(--muted); }
.wl-pill { background: var(--panel); padding: 0 5px; border-radius: 3px; }

/* v3.10: messaggi dell'amministratore (finestra all'apertura, Account › Messaggi, Maintenance › Messaggi) */
.msg-bg { align-items: center; }
.msg-modal { max-width: 520px; gap: 10px; }
.msg-eb { font-size: 11px; letter-spacing: .12em; color: var(--accent); }
.msg-modal h2, .msg-card h2 { font-size: 20px; margin: 0; }
.msg-body { display: flex; flex-direction: column; gap: 8px; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; }
.msg-body p, .msg-body ul { margin: 0; }
.msg-body ul { padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }
.msg-body b { font-weight: 600; }
.msg-modal .msg-body { max-height: 60vh; overflow-y: auto; }
.msg-foot { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.msg-foot .dim { font-size: 12.5px; }
.msg-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.msg-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.msg-ta { min-height: 230px; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.5; }
.msg-ta.sm { min-height: 110px; }
.msg-prev { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.msg-card { background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.msg-r1 { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg-r1 .dim { font-size: 12.5px; }
.msg-read { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.msg-acts { display: flex; gap: 6px; justify-content: flex-end; }
.msg-arow { padding: 6px 0; border-top: 1px solid var(--line); }
.msg-arow .btn { margin-left: auto; }
@media (max-width: 760px) {
  .msg-grid { grid-template-columns: 1fr; }
  .msg-row { grid-template-columns: 1fr; gap: 6px; }
  .msg-acts { justify-content: flex-start; }
  .msg-modal { padding: 18px; }
}

/* v3.11: sovrapposizioni di MIX e ADR (Agenda, Workload, Assegnazioni) */
.clash-list { display: flex; flex-direction: column; gap: 8px; }
.clash-list:empty { display: none; }
.rt-blk.ev-clash, .rt-mix.ev-clash { box-shadow: 0 0 0 2px var(--crit); }
.ev-cl { position: absolute; z-index: 4; width: 15px; height: 15px; border-radius: 50%; background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.acl { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; margin-left: auto; flex: none; }
.clash-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--crit) 50%, transparent); background: color-mix(in srgb, var(--crit) 10%, transparent); font-size: 13px; }
.clash-notes .row { gap: 8px; align-items: flex-start; flex-wrap: nowrap; }
.clash-notes .acl { margin-left: 0; margin-top: 1px; }
.am-nm { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.am-busy { color: var(--crit); font-size: 11.5px; }
.ev-blk.ev-clash { box-shadow: 0 0 0 2px var(--crit); }

/* v3.11.2: zoom con due dita (il browser non zooma la pagina sulla timeline) e lenti dello zoom */
.tl-scroll { touch-action: pan-x pan-y; }
.btn.zbtn { display: inline-flex; align-items: center; justify-content: center; padding-left: 8px; padding-right: 8px; }
.btn.zbtn .lens { display: block; }
.seg .zoom-ind.zr { gap: 5px; }
.seg .zoom-ind.zr .lens { width: 14px; height: 14px; }
.tl-scroll[data-scroll="ritmo"] { touch-action: auto; }

/* v3.12: giorno vero di arrivo (codina sotto gli altri segni, pallino pieno; sul telefono area di tocco di 24 px) */
.arr-tail { position: absolute; z-index: 0; height: 2px; background: var(--ok); opacity: .75; border-radius: 1px; pointer-events: none; }
.arr-dot { position: absolute; border-radius: 50%; background: var(--panel); border: 2px solid var(--ok); box-sizing: border-box; cursor: pointer; } /* 3.12.1: anello (cerchio vuoto), non si confonde con il pick-up pieno */
.arr-reel { position: absolute; border-radius: 50%; background: var(--panel); border: 1.5px solid var(--ok); box-sizing: border-box; pointer-events: none; }
@media (pointer: coarse) { .arr-dot::before { content: ''; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); } }
