/* ---------- token: una palette, un accento, tre raggi ---------- */

:root {
  color-scheme: dark;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-1: 12px;
  --r-2: 18px;
  --r-3: 30px;

  --bg-0: #0a0a0c;
  --bg-1: #1c1c20;
  --glass: #1c1c20;
  --glass-2: #232428;
  --glass-hi: rgba(255, 255, 255, 0.06);
  --glint: rgba(255, 255, 255, 0.13);
  --sheen: rgba(255, 255, 255, 0.055);
  --rim-hi: rgba(255, 255, 255, 0.82);
  --rim-mid: rgba(255, 255, 255, 0.3);
  --rim-lo: rgba(255, 255, 255, 0.12);
  --ripple: rgba(255, 255, 255, 0.2);
  --card-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), inset 0 -1px 1px rgba(255, 255, 255, 0.1), inset 3px 4px 12px -6px rgba(255, 255, 255, 0.24), inset -4px -6px 14px -8px rgba(255, 255, 255, 0.12), inset 0 -16px 28px -18px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -22px rgba(0, 0, 0, 0.75);

  --ink: #f5f5f7;
  --ink-2: rgba(235, 235, 245, 0.72);
  --ink-3: rgba(235, 235, 245, 0.58);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --accent: #1f6fe6;
  --accent-text: #7fb0ff;
  --accent-ink: #ffffff;
  --fresh: #37d17a;
  --warn: #f0b95c;
  --bad: #f07a6c;

  --rail: 252px;
  --blur: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -22px rgba(0, 0, 0, 0.75);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --sans: -apple-system, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #eae7df;
  --bg-1: #f4f1ea;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-2: rgba(255, 255, 255, 0.45);
  --glass-hi: rgba(255, 255, 255, 0.85);
  --ink: #14161a;
  --ink-2: rgba(20, 22, 26, 0.74);
  --ink-3: rgba(20, 22, 26, 0.62);
  --line: rgba(10, 15, 12, 0.12);
  --line-strong: rgba(10, 15, 12, 0.22);
  --accent: #1f6fe6;
  --accent-text: #1857c0;
  --accent-ink: #ffffff;
  --fresh: #157a5b;
  --warn: #9a6a12;
  --bad: #b03d33;
  --shadow: 0 26px 60px rgba(50, 55, 40, 0.16);
}



* { box-sizing: border-box; }

* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 15%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 13%, transparent);
  border-radius: var(--r-3);
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 26%, transparent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
.drawer, .dlg__form, .finder__list, .bcol__list { overscroll-behavior: contain; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-0);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wall {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(880px 620px at 76% -6%, rgba(90, 150, 255, 0.3), transparent 58%),
    radial-gradient(820px 700px at 12% 104%, rgba(64, 190, 168, 0.3), transparent 60%),
    radial-gradient(680px 520px at 52% 42%, rgba(240, 185, 92, 0.12), transparent 66%),
    linear-gradient(163deg, #101713 0%, #0a0d0b 58%, #070908 100%);
}
.wall::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(closest-side at 30% 30%, rgba(198, 242, 78, 0.12), transparent 70%),
    radial-gradient(closest-side at 70% 70%, rgba(64, 190, 168, 0.12), transparent 70%);
  filter: blur(40px);
  animation: drift 34s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}
html[data-wall="moss"] .wall {
  background:
    radial-gradient(900px 640px at 22% -8%, rgba(110, 235, 150, 0.34), transparent 58%),
    radial-gradient(860px 660px at 88% 106%, rgba(30, 190, 140, 0.34), transparent 62%),
    radial-gradient(600px 500px at 50% 50%, rgba(190, 250, 120, 0.1), transparent 70%),
    linear-gradient(160deg, #0a1a12, #050b07 62%);
}
html[data-wall="sand"] .wall {
  background:
    radial-gradient(900px 640px at 70% -8%, rgba(250, 210, 130, 0.36), transparent 58%),
    radial-gradient(860px 660px at 8% 108%, rgba(225, 120, 80, 0.3), transparent 62%),
    radial-gradient(600px 500px at 46% 46%, rgba(255, 170, 80, 0.14), transparent 70%),
    linear-gradient(160deg, #1d150c, #0d0906 62%);
}
.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }

.glass, .rail, .card, .panel, .taskform, .island, .tabbar, .lens, .toast, .stat, .mcard, .snav, .calcard, .profile, .dlg, .combo__list {
  position: relative;
  background:
    radial-gradient(260px circle at var(--gx, -400px) var(--gy, -400px), var(--glint), transparent 70%),
    linear-gradient(172deg, var(--sheen) 0%, transparent 34%),
    var(--glass);
  border: 0;
  box-shadow: var(--card-shadow);
}

.glass::before, .rail::before, .card::before, .panel::before, .taskform::before,
.island::before, .tabbar::before, .stat::before, .mcard::before, .snav::before,
.calcard::before, .profile::before, .dlg::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 300deg, var(--rim-hi) 0deg, var(--rim-lo) 55deg, transparent 90deg, var(--rim-lo) 140deg, var(--rim-mid) 180deg, var(--rim-lo) 220deg, transparent 270deg, var(--rim-hi) 330deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}
html[data-glass="on"] .rail,
html[data-glass="on"] .card,
html[data-glass="on"] .panel,
html[data-glass="on"] .taskform,
html[data-glass="on"] .island,
html[data-glass="on"] .tabbar,
html[data-glass="on"] .lens,
html[data-glass="on"] .toast,
html[data-glass="auto"] .rail,
html[data-glass="auto"] .card,
html[data-glass="auto"] .panel,
html[data-glass="auto"] .taskform,
html[data-glass="auto"] .island,
html[data-glass="auto"] .tabbar,
html[data-glass="auto"] .lens,
html[data-glass="auto"] .toast { backdrop-filter: blur(var(--blur)) saturate(150%) brightness(1.04); }

/* ---------- rail ---------- */

.rail {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-radius: 0 var(--r-3) var(--r-3) 0;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.mark { width: 19px; height: 19px; fill: var(--accent); }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.brand__num { color: var(--ink-3); font-family: var(--mono); font-size: 11px; margin-left: 2px; }

.nav { position: relative; display: grid; gap: 4px; }
.lens {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 40px;
  border-radius: var(--r-2);
  transform: translateY(calc(var(--lens-i, 0) * 44px));
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s var(--ease);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--glass-hi)), transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line-strong));
  pointer-events: none;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-2);
  color: var(--ink-2);
  font-size: 14px;
  text-align: left;
}
.nav__item:hover { color: var(--ink); }
.nav__item[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav__item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav__item[aria-current="page"] svg { stroke: var(--accent); }
.nav__item em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.railstats {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: var(--r-2);
  background: var(--glass-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}
.railstats span { display: flex; justify-content: space-between; gap: 8px; }
.railstats b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); }
.rail__foot { margin-top: auto; }

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 30px 12px;
  padding-right: 250px;
}
.topbar__title { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.topbar__search { display: none !important; margin-left: auto; padding: 8px 11px; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--glass-2); color: var(--ink-3); }
.topbar__search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.searchbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--glass-2);
  color: var(--ink-3);
  font-size: 12.5px;
}
.railsearch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--glass-2);
  color: var(--ink-3);
  font-size: 12.5px;
  margin-top: -8px;
}
.railsearch:hover { color: var(--ink); border-color: var(--line-strong); }
.railsearch svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.railsearch kbd { margin-left: auto; font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-radius: var(--r-1); padding: 1px 6px; }
.searchbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.searchbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.searchbtn kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-radius: var(--r-1); padding: 1px 6px; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--glass-2);
  min-width: 250px;
}
.search svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 13px; outline: none; }
.search input::placeholder { color: var(--ink-3); }
.search kbd { font-family: var(--mono); font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-1); padding: 1px 6px; }

/* ---------- island ---------- */

.island {
  position: fixed;
  bottom: 24px;
  right: 80px;
  top: auto;
  left: auto;
  transform: none;
  z-index: 40;
  width: 380px;
  border-radius: var(--r-3);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), border-radius 0.3s var(--ease);
}
.island[data-stale="true"] {
  background: color-mix(in srgb, var(--warn) 14%, var(--glass));
  border-color: color-mix(in srgb, var(--warn) 48%, transparent);
}
.island[data-open="true"] { border-radius: var(--r-3); }
.island[data-open="true"] .island__bar { border-radius: var(--r-3) var(--r-3) 0 0; }

.island__bar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 18px; border-radius: var(--r-3); font-size: 13px; color: var(--ink-2); }
.island__count b { color: var(--ink); font-family: var(--mono); font-size: 14px; }
.island__sep { width: 1px; height: 14px; background: var(--line-strong); }
.island__state { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.island__chev { margin-left: auto; width: 6px; height: 6px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.3s var(--ease); }
.island__bar[aria-expanded="true"] .island__chev { transform: rotate(-135deg); }

.aging { width: 17px; height: 17px; transform: rotate(-90deg); flex: none; }
.aging__bg { fill: none; stroke: var(--line-strong); stroke-width: 1.6; }
.aging__fg { fill: none; stroke: var(--fresh); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 39; stroke-dashoffset: 39; transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.6s var(--ease); }
.island[data-stale="true"] .aging__fg, .island[data-age="late"] .aging__fg { stroke: var(--warn); }

.island__timer { display: flex; align-items: center; gap: 6px; margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--accent-text); }
.island__timer svg { width: 15px; height: 15px; transform: rotate(-90deg); }
.ring__bg { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.ring__fg { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 39; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }

.island__panel { padding: 8px 18px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }\n.island[data-open="true"] .island__panel { order: -1; border-top: 0; border-bottom: 1px solid var(--line); }
.island__row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
.island__row b { color: var(--ink-2); font-family: var(--mono); font-weight: 500; }
.island.flash { animation: flash 0.9s var(--ease); }
@keyframes flash { 0% { box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--fresh) 55%, transparent); } 100% { box-shadow: var(--shadow), 0 0 0 14px transparent; } }

/* ---------- stage ---------- */

.stage { padding: 10px 30px 104px; min-width: 0; width: 100%; max-width: 1180px; margin-inline: auto; }
.view { display: grid; gap: 16px; }

.eyebrow { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); }
.display { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.hint { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.sectionTitle { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: baseline; gap: 8px; }

.homehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-top: 6px; }
.clock { font-family: var(--mono); font-size: 30px; color: var(--ink-2); letter-spacing: -0.02em; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { border-radius: var(--r-3); padding: 16px 18px; display: grid; gap: 2px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
html[data-glass="on"] .stat { backdrop-filter: blur(var(--blur)) saturate(140%); }
.stat b { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.stat[data-tone="warn"] b { color: var(--warn); }
.stat[data-tone="bad"] b { color: var(--bad); }
.stat[data-tone="good"] b { color: var(--accent); }

.homegrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.homecol { display: grid; gap: 14px; align-content: start; min-width: 0; }
.card {
  border-radius: var(--r-3);
  border-color: color-mix(in srgb, var(--ink) 12%, transparent);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  align-content: start;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 46%),
    var(--glass);
}
.panel {
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%),
    var(--glass);
}
.card--focus { min-height: 0; }
.card__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.card__title { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.chipkind { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--r-1); border: 1px solid var(--line-strong); color: var(--ink-2); }
.chipkind[data-kind="gate"] { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.chipkind[data-kind="work"] { color: var(--fresh); border-color: color-mix(in srgb, var(--fresh) 35%, transparent); }
.chipkind[data-kind="decision"] { color: #c3a6f0; border-color: rgba(195, 166, 240, 0.35); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  padding: 7px 13px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--glass-2);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--accent:hover { color: var(--accent-ink); filter: brightness(1.05); }
.btn--ghost { background: none; }
.btn--wide { width: 100%; justify-content: center; }

.miniList { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 8px; border-radius: var(--r-2); text-align: left; width: 100%; }
.mini:hover { background: var(--glass-2); }
.mini i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mini[data-kind="work"] i { background: var(--fresh); }
.mini[data-kind="decision"] i { background: #c3a6f0; }
.mini[data-kind="gate"] i { background: var(--warn); }
.mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.mini em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---------- tasks ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--glass-2); }
.seg button { padding: 7px 14px; font-size: 12.5px; color: var(--ink-3); }
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); }
select, input[type="date"], input[type="text"], input[type="time"], input[type="number"] {
  background: var(--glass-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--r-2);
  padding: 8px 11px;
  font: inherit;
  font-size: 13px;
}
select { min-width: 150px; }

.taskform { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) auto auto auto; gap: 8px; padding: 12px; border-radius: var(--r-2); }

.tasklist { list-style: none; margin: 0; padding: 0; display: grid; }
.taskrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 12px; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.taskrow__main { display: grid; gap: 2px; min-width: 0; }
.taskrow__meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.taskrow:hover { background: var(--glass-2); }
.check { width: 20px; height: 20px; border-radius: var(--r-1); border: 1.6px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.check[aria-checked="true"]::after { content: ""; width: 5px; height: 9px; border-right: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: translateY(-1px) rotate(42deg); }
.taskrow__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.taskrow[data-state="done"] .taskrow__title { color: var(--ink-3); text-decoration: line-through; }
.taskrow__project { font-family: var(--mono); font-size: 10px; color: var(--ink-3); padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--r-1); white-space: nowrap; }
.prio { width: 4px; height: 22px; border-radius: var(--r-1); background: var(--line-strong); }
.prio[data-p="3"] { background: var(--bad); }
.prio[data-p="2"] { background: var(--warn); }
.prio[data-p="1"] { background: var(--fresh); }
.due { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.due[data-over="true"] { color: var(--bad); }
.sourcebadge { font-family: var(--mono); font-size: 10px; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--r-1); padding: 1px 6px; }

/* ---------- calendar ---------- */

.calbar { display: flex; align-items: center; gap: 10px; }
.calbar b { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; text-transform: capitalize; }
.calsplit { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__head { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); text-align: center; padding: 4px 0; }
.cal__day { min-height: 72px; border-radius: var(--r-2); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: var(--glass-2); padding: 8px; display: grid; gap: 4px; align-content: start; text-align: left; }
.cal__day[data-empty="true"] { border-color: transparent; background: none; }
.cal__day:hover { background: color-mix(in srgb, var(--accent) 8%, var(--glass-2)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.cal__day[data-weekend="true"]:not([data-empty="true"]) { background: color-mix(in srgb, var(--bg-0) 25%, var(--glass-2)); }
.cal__day[data-today="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.cal__day[data-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cal__n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.cal__day[data-today="true"] .cal__n { color: var(--accent-text); }
.cal__dot { display: flex; gap: 3px; flex-wrap: wrap; }
.cal__dot i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal__dot i[data-kind="event"] { background: #c3a6f0; }
.cal__dot i[data-kind="snooze"] { background: var(--warn); }
.cal__label { font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calev { font-size: 10px; line-height: 1.5; padding: 0 4px; border-radius: var(--r-1); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calev[data-kind="event"] { background: color-mix(in srgb, #c3a6f0 22%, transparent); }
.calev[data-kind="snooze"] { background: color-mix(in srgb, var(--warn) 20%, transparent); }

/* ---------- projects, team, insights ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__name { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.progress { display: flex; align-items: center; gap: 14px; }
.ringwrap { position: relative; display: grid; place-items: center; }
.ringwrap b { position: absolute; font-family: var(--mono); font-size: 11px; color: var(--ink-2); font-weight: 500; }
.ring { width: 58px; height: 58px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: color-mix(in srgb, var(--ink-3) 32%, transparent); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.member .metric b { font-size: 13px; white-space: nowrap; }
.metric { display: grid; gap: 1px; }
.metric b { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.metric span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }

.member { display: grid; gap: 10px; }
.member__head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--accent-ink); background: var(--accent); flex: none; }
.avatar[data-role="agente"] { background: #c3a6f0; }
.track { height: 6px; border-radius: var(--r-1); background: var(--line); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--accent); }
.glassbar { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.bar-row .track { height: 7px; }
.bar-row .val { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); text-align: right; }

.panel { border-radius: var(--r-3); padding: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.chart svg { width: 100%; height: auto; display: block; max-height: 210px; }
.chart .bar { fill: color-mix(in srgb, var(--accent) 78%, transparent); }
.chart .bar2 { fill: color-mix(in srgb, var(--fresh) 65%, transparent); }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--ink-3); font-family: var(--mono); font-size: 9px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-1); margin-right: 5px; }

.field { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.field:first-of-type { border-top: 0; }
.field code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); }
.swatches button[data-accent-set="lime"] { background: #c6f24e; }
.swatches button[data-accent-set="azzurro"] { background: #7cc6f5; }
.swatches button[data-accent-set="corallo"] { background: #f58a76; }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
code.block { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px 12px; overflow-x: auto; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 18px); padding: 10px 18px; border-radius: var(--r-3); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tabbar { display: none; }

@media (min-width: 921px) and (max-width: 1200px) {
  .island { top: 66px; width: min(460px, calc(100vw - var(--rail) - 48px)); }
  .stage { padding-top: 64px; }
}

@media (max-width: 920px) {
  body { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 14px 16px 6px; }
  .topbar__title { font-size: 20px; }
  .topbar__search { display: inline-flex !important; }
  .stage { padding: 8px 16px 120px; }
  .island { top: 8px; left: 50%; width: calc(100vw - 24px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .homegrid { grid-template-columns: 1fr; }
  .split, .calsplit { grid-template-columns: 1fr; }
  .taskform { grid-template-columns: 1fr; }
  .taskrow { grid-template-columns: auto minmax(0, 1fr) auto 12px; }
  .sourcebadge { display: none; }
  .display { font-size: 24px; }
  .card__title { font-size: 21px; }
  .stat { padding: 13px 15px; }
  .stat b { font-size: 24px; line-height: 1.25; }
  .clock { font-size: 22px; }
  .cal__day { min-height: 58px; padding: 5px; }
  .cal__label { display: none; }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    border-radius: var(--r-3) var(--r-3) 0 0;
    border-bottom: 0;
  }
  .tabbar button { display: grid; justify-items: center; gap: 4px; padding: 4px 0; font-size: 10px; color: var(--ink-3); }
  .tabbar button[aria-current="page"] { color: var(--ink); }
  .tabbar button[aria-current="page"] svg { stroke: var(--accent); }
  .tabbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
  .toast { bottom: 86px; }
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="auto"] .rail,
  html[data-glass="auto"] .card,
  html[data-glass="auto"] .panel,
  html[data-glass="auto"] .island,
  html[data-glass="auto"] .taskform,
  html[data-glass="auto"] .tabbar,
  html[data-glass="auto"] .lens,
  html[data-glass="auto"] .toast { backdrop-filter: none; }
  /* Senza sfocatura il vetro resta vetro: piu denso, non un rettangolo nero. */
  .rail, .card, .panel, .island, .stat {
    background:
      linear-gradient(170deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 42%),
      color-mix(in srgb, var(--bg-1) 88%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
/* ---------- gruppi e righe ---------- */

.groups { display: grid; gap: 24px; margin-top: 8px; }
.group__head { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.group__head h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.rows { list-style: none; margin: 0; padding: 0; }
.row { border: 1px solid transparent; border-bottom-color: var(--line); border-radius: var(--r-2); }
.row:hover { background: var(--glass-2); }
.row.is-open { background: var(--glass-2); border-color: var(--line); }
.row__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px; text-align: left; }
.row__main { min-width: 0; display: grid; gap: 3px; }
.row__title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__chev { width: 7px; height: 7px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.28s var(--ease); }
.row.is-open .row__chev { transform: rotate(-135deg); }
.row__body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 0fr; transition: grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
.row.is-open .row__body { grid-template-rows: 1fr; }
.row__inner { overflow: hidden; }
.row__panel { padding: 0 12px 14px; display: grid; gap: 10px; }
.sourcelist { display: grid; gap: 2px; }
.source { display: flex; overflow: hidden; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); padding: 3px 0; text-align: left; width: fit-content; max-width: 100%; }
.source:hover { color: var(--ink-2); }
.source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filterbar, .calbar { scrollbar-width: none; }

.empty { padding: 30px 4px; color: var(--ink-3); display: grid; gap: 8px; }
.empty h2 { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--ink); }

/* ---------- animazioni ---------- */

@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.view:not([hidden]) .enter { animation: enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
html[data-anim="off"] .enter, html[data-anim="off"] .view { animation: none !important; }

@keyframes viewIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
/* transizione delle viste gestita in JS (WAAPI), per non duplicare l'animazione */

.card, .stat, .mcard { overflow: hidden; }
.island__bar { position: relative; }

/* ripple al click, come Pane */
.ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 38%, var(--ripple) 62%, transparent 72%);
  animation: rippleOut 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 2;
}
@keyframes rippleOut { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(24); opacity: 0; } }

/* rilievo mentre trascini una card */
.tcard.is-dragging { transform: scale(1.03) rotate(1.2deg); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); opacity: 0.9; z-index: 4; }
.btn:active, .nav__item:active, .seg button:active { transform: scale(0.975); }
.mcard:active { transform: scale(0.995); }

/* ---------- finder ---------- */

.finder { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.45); display: grid; place-items: start center; padding-top: 13vh; }
.finder__box { width: min(640px, calc(100vw - 32px)); border-radius: var(--r-3); border: 1px solid var(--line-strong); background: var(--glass); box-shadow: var(--shadow); overflow: hidden; }
html[data-glass="on"] .finder__box, html[data-glass="auto"] .finder__box { backdrop-filter: blur(26px) saturate(160%); }
.finder__box input { width: 100%; padding: 16px 18px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.finder__list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.finder__list button { display: flex; justify-content: space-between; gap: 14px; width: 100%; padding: 9px 12px; border-radius: var(--r-2); text-align: left; font-size: 13.5px; color: var(--ink-2); }
.finder__list button em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.finder__list li.is-active button { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
/* ---------- tasks: pagina come Pane ---------- */

.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pagetitle { font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.pagetitle .ch { display: inline-block; animation: charIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
body[data-view="tasks"] .topbar__title { display: none; }
body[data-view="tasks"] .stage { padding-bottom: 16px; max-width: 1360px; }
@keyframes charIn { from { opacity: 0; transform: translateY(7px) rotate(2deg); } to { opacity: 1; transform: none; } }
.pagehead__actions { display: flex; align-items: center; gap: 10px; }

.stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat--sm b { font-size: 24px; }

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--glass-2);
}
html[data-glass="on"] .filterbar { backdrop-filter: blur(var(--blur)) saturate(140%); }
.filterbar select, .filterbar input {
  background: transparent;
  border: 0;
  border-radius: var(--r-3);
  padding: 8px 14px;
  color: var(--ink-2);
  font-size: 12.5px;
  outline: none;
}
.filterbar select:hover, .filterbar input:focus { background: var(--glass); color: var(--ink); }
.filterbar input { flex: 1; min-width: 170px; }
.filterbar .btn { margin-left: auto; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 12px;
  align-items: stretch;
  height: calc(100dvh - 360px);
  min-height: 380px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}
.bcol {
  border-radius: var(--r-3);
  background: var(--glass-2);
  border: 1px solid var(--line);
  padding: 12px 10px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  height: 100%;
}
html[data-glass="on"] .bcol { backdrop-filter: blur(var(--blur)) saturate(130%); }
.bcol[data-over="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--glass-2)); }
.bcol__head { display: flex; align-items: center; gap: 8px; padding: 2px 6px; }
.bcol__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.bcol[data-status="doing"] .bcol__dot { background: #7cc6f5; }
.bcol[data-status="review"] .bcol__dot { background: #c3a6f0; }
.bcol[data-status="done"] .bcol__dot { background: var(--fresh); }
.bcol__name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.bcol__count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.bcol__add { margin-left: auto; width: 26px; height: 26px; border-radius: var(--r-1); display: grid; place-items: center; color: var(--ink-3); border: 1px solid var(--line); font-size: 15px; line-height: 1; }
.bcol__add:hover { color: var(--ink); border-color: var(--line-strong); }
.bcol__list { display: grid; gap: 8px; align-content: start; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 4px; }
.bcol__list::-webkit-scrollbar { width: 6px; }
.bcol__list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-1); }
.bcol__more { font-size: 11.5px; color: var(--ink-3); padding: 6px; border-radius: var(--r-1); }
.bcol__more:hover { color: var(--ink); background: var(--glass); }

.tcard { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px; display: grid; gap: 9px; cursor: grab; transition: transform 0.18s var(--ease), border-color 0.18s var(--ease); }
.tcard:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.tcard:active { cursor: grabbing; }
.tcard__top { display: flex; align-items: center; gap: 6px; justify-content: space-between; min-width: 0; }
.pchip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; padding: 3px 8px; border-radius: var(--r-3); max-width: 72%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pchip span { overflow: hidden; text-overflow: ellipsis; }
.hue-0 { background: rgba(240, 160, 90, 0.16); color: #f0a05a; }
.hue-1 { background: rgba(124, 198, 245, 0.16); color: #7cc6f5; }
.hue-2 { background: rgba(126, 224, 168, 0.15); color: #7ee0a8; }
.hue-3 { background: rgba(195, 166, 240, 0.16); color: #c3a6f0; }
.hue-4 { background: rgba(240, 122, 108, 0.16); color: #f07a6c; }
.tcard__title { font-size: 13.5px; line-height: 1.35; font-weight: 500; margin: 0; }
.tcard[data-status="done"] .tcard__title { text-decoration: line-through; color: var(--ink-3); }
.tcard__meta { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ink-3); }
.tcard__move { margin-left: auto; width: 22px; height: 22px; border-radius: var(--r-1); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.tcard__move:hover { color: var(--accent); background: var(--glass-2); }
.prio-badge { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; padding: 2px 6px; border-radius: var(--r-1); white-space: nowrap; }
.prio-badge[data-p="3"] { background: rgba(240, 122, 108, 0.18); color: var(--bad); }
.prio-badge[data-p="2"] { background: rgba(240, 185, 92, 0.16); color: var(--warn); }
.prio-badge[data-p="1"] { background: rgba(126, 224, 168, 0.14); color: var(--fresh); }

.dlg { border: 1px solid var(--line-strong); border-radius: var(--r-3); background: var(--bg-1); color: var(--ink); padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
html[data-glass="on"] .dlg { background: var(--glass); backdrop-filter: blur(28px) saturate(150%); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.5); }
.dlg__form { display: grid; gap: 12px; padding: 20px; }
.dlg__title { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.dlg__form label { display: grid; gap: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.dlg__form input, .dlg__form select { background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 9px 11px; color: var(--ink); font: inherit; font-size: 13px; }
.dlg__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 920px) {
  .pagetitle { font-size: 28px; }
  .board { grid-template-columns: repeat(4, minmax(78vw, 1fr)); scroll-snap-type: x mandatory; scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }
  .bcol { scroll-snap-align: start; }
  .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filterbar { border-radius: var(--r-2); }
  .filterbar input { min-width: 120px; }
}
/* ---------- calendar, projects, team: dettagli ---------- */

.calsplit { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.calbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.calbar b { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; text-transform: capitalize; }
.calbar .btn { padding: 5px 10px; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week__day { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--glass-2); padding: 8px; min-height: 260px; display: grid; gap: 5px; align-content: start; }
.week__day[data-today="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.week__name { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.week__n { font-family: var(--mono); font-size: 14px; color: var(--ink-2); margin-bottom: 2px; }
.weekev { font-size: 10px; line-height: 1.4; text-align: left; padding: 2px 5px; border-radius: var(--r-1); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weekev[data-kind="event"] { background: color-mix(in srgb, #c3a6f0 22%, transparent); }
.weekev[data-kind="snooze"] { background: color-mix(in srgb, var(--warn) 20%, transparent); }

.agenda { position: sticky; top: 12px; display: grid; gap: 10px; align-content: start; }
.agenda .miniList { gap: 0; }
.agenda__item { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); border-radius: 0; }
.agenda__item em { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.agenda__form { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 6px; }
.agenda__form select { min-width: 0; padding: 8px 10px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--glass-2); color: var(--ink-2); font-size: 12px; }
.agenda__form:has(select) { grid-template-columns: minmax(0, 1fr) auto; }
.agenda__form input[type="text"] { min-width: 0; }

.pcard { cursor: pointer; }
.pcard__desc { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__next { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.pcard__nextstep { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.member__titles { min-width: 0; flex: 1; }
.member__desc { margin: 0; min-height: 2.9em; font-size: 12px; color: var(--ink-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.member__load { display: grid; gap: 5px; margin-top: auto; }
.member__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot[data-tone="active"] { background: var(--fresh); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fresh) 22%, transparent); }
.dot[data-tone="recent"] { background: var(--warn); }
.dot[data-tone="idle"] { background: var(--ink-3); opacity: 0.6; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(390px, 100vw); z-index: 70; scrollbar-gutter: stable; background: var(--bg-1); border-left: 1px solid var(--line-strong); box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45); padding: 24px; overflow-y: auto; }
html[data-glass="on"] .drawer { background: var(--glass); backdrop-filter: blur(28px) saturate(150%); }
.drawer__close { position: absolute; top: 10px; right: 14px; font-size: 24px; line-height: 1; color: var(--ink-3); }
.drawer__close:hover { color: var(--ink); }
.drawer__body { display: grid; gap: 14px; }
.drawer__desc { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.dl { display: grid; gap: 0; }
.dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 8px 0; border-top: 1px solid var(--line); }
.dl span { color: var(--ink-3); }
.dl b { font-family: var(--mono); font-weight: 500; }

@media (max-width: 920px) {
  .calsplit { grid-template-columns: 1fr; }
  .agenda { position: static; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week__day { min-height: 140px; }
  .drawer { width: 100vw; }
  .agenda__form { grid-template-columns: 1fr; }
}
/* ---------- task: combo progetto, stima, card piu' larghe ---------- */

.combo { position: relative; }
.combo input { width: 100%; }
.combo__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  isolation: isolate;
  max-height: 220px;
  overflow-y: auto;
}
html[data-glass="on"] .combo__list { background: color-mix(in srgb, var(--bg-1) 97%, transparent); backdrop-filter: blur(20px); }
.combo__list button { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: var(--r-1); font-size: 12.5px; color: var(--ink-2); }
.combo__list button:hover, .combo__list button:focus { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }

.est { font-family: var(--mono); font-size: 10px; color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 1px 5px; }

.board { grid-template-columns: repeat(4, minmax(232px, 1fr)); }
.tcard { padding: 11px 12px; gap: 7px; }
.tcard__title { font-size: 13px; line-height: 1.32; }
.tcard__move { width: 20px; height: 20px; font-size: 11px; opacity: 0; transition: opacity 0.15s var(--ease); }
.tcard:hover .tcard__move, .tcard:focus-within .tcard__move { opacity: 1; }
.tcard__meta { margin-top: 1px; }

/* ---------- calendar: card, celle fisse, agenda ---------- */

.calcard { padding: 16px; display: grid; gap: 12px; }
.cal { gap: 5px; }
.cal__day {
  min-height: 0;
  height: 96px;
  padding: 6px 7px;
  gap: 3px;
  overflow: hidden;
  align-content: start;
}
.cal__day[data-other="true"] { opacity: 0.42; }
.cal__day[data-other="true"] .cal__n { color: var(--ink-3); }
.cal__chips { display: grid; gap: 3px; overflow: hidden; }
.cal__more { font-size: 9.5px; color: var(--ink-3); font-family: var(--mono); }
.calev { font-size: 9.5px; padding: 1px 5px; border-radius: var(--r-1); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agenda__list { list-style: none; margin: 0; padding: 0; display: grid; }
.agenda__row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.agenda__row:first-child { border-top: 0; }
.agenda__when { display: grid; gap: 1px; }
.agenda__when b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); }
.agenda__when span { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }
.agenda__body { display: grid; gap: 3px; min-width: 0; }
.agenda__title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; color: var(--ink-3); }
.agenda__del { width: 20px; height: 20px; border-radius: var(--r-1); color: var(--ink-3); font-size: 14px; line-height: 1; opacity: 0; }
.agenda__row:hover .agenda__del { opacity: 1; }
.agenda__del:hover { color: var(--bad); background: var(--glass-2); }
.agenda__form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.agenda__form input { min-width: 0; }
.agenda__form input[type="text"]:first-child { grid-column: 1 / -1; }
.agenda__form .btn { grid-column: 1 / -1; }

@media (max-width: 920px) {
  .cal__day { height: 86px; }
  .agenda__row { grid-template-columns: 48px minmax(0, 1fr) auto; }
}
/* ================= Tasks 1:1 con Pane ================= */

body[data-view="tasks"] {
  --tk-surface: #1c1c20;
  --tk-text: #f5f5f7;
  --tk-muted: rgba(235, 235, 245, 0.7);
  --tk-chip: rgba(150, 150, 175, 0.16);
}

body[data-view="tasks"] .stage { padding: 14px 80px 48px 30px; max-width: 1575px; }

body[data-view="tasks"] .pagehead { align-items: flex-start; gap: 32px; margin-bottom: 24px; }
body[data-view="tasks"] .pagetitle {
  font-family: var(--sans);
  font-size: 56px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -1.7px;
  color: var(--tk-text);
}
body[data-view="tasks"] #taskSub {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--tk-muted);
}

body[data-view="tasks"] .pagehead__actions { gap: 10px; }
body[data-view="tasks"] .seg { background: var(--tk-chip); padding: 3px; border: 0; height: 40px; }
body[data-view="tasks"] .seg button { height: 34px; padding: 0 14px 0 12px; font-size: 14px; font-weight: 600; border-radius: var(--r-3); color: var(--tk-muted); }
body[data-view="tasks"] .seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); color: var(--tk-text); }
body[data-view="tasks"] #newTaskBtn {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r-3);
  font-size: 15px;
  font-weight: 600;
  border: 0;
}

/* statistiche: pillole compatte, non card larghe */
body[data-view="tasks"] .stats--4 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
body[data-view="tasks"] .stats--4 .stat {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 10px 16px;
  border-radius: var(--r-2);
  border: 0;
  background: var(--tk-surface);
  box-shadow: none;
  gap: 2px;
}
body[data-view="tasks"] .stats--4 .stat b {
  font-family: var(--sans);
  font-size: 23px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.46px;
  color: var(--tk-text);
}
body[data-view="tasks"] .stats--4 .stat span {
  order: -1;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tk-muted);
}

/* barra filtri */
body[data-view="tasks"] .filterbar {
  height: 54px;
  padding: 7px;
  gap: 8px;
  border: 0;
  border-radius: var(--r-3);
  background: var(--tk-surface);
  backdrop-filter: none;
  margin-bottom: 24px;
}
body[data-view="tasks"] .filterbar select {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-3);
  background: var(--tk-chip);
  color: var(--tk-text);
  font-size: 14.5px;
  font-weight: 600;
}
body[data-view="tasks"] .filterbar input {
  height: 40px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--tk-text);
  font-size: 15px;
}
body[data-view="tasks"] .filterbar input::placeholder { color: var(--tk-muted); }
body[data-view="tasks"] .filterbar .btn { height: 40px; border-radius: var(--r-3); border: 0; font-size: 14.5px; color: var(--tk-muted); }

/* board e colonne */
body[data-view="tasks"] .board {
  gap: 20px;
  height: calc(100dvh - 420px);
  min-height: 320px;
}
body[data-view="tasks"] .bcol {
  padding: 14px 10px 12px;
  border: 0;
  border-radius: var(--r-3);
  background: var(--tk-surface);
  backdrop-filter: none;
}
body[data-view="tasks"] .bcol__head {
  padding: 0 2px 12px 8px;
  gap: 10px;
  min-height: 44px;
}
body[data-view="tasks"] .bcol__name {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.16px;
  color: var(--tk-text);
}
body[data-view="tasks"] .bcol__count {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1;
  font-weight: 650;
  color: var(--tk-muted);
  background: var(--tk-chip);
  padding: 5px 7px;
  border-radius: var(--r-3);
  min-width: 28px;
  text-align: center;
}
body[data-view="tasks"] .bcol__add {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--r-3);
  color: var(--tk-muted);
  font-size: 16px;
}
body[data-view="tasks"] .bcol__add:hover { background: var(--tk-chip); color: var(--tk-text); }
body[data-view="tasks"] .bcol__list { gap: 10px; }

/* card */
body[data-view="tasks"] .tcard {
  padding: 12px 12px 12px 14px;
  gap: 10px;
  border: 0;
  border-radius: var(--r-2);
  background: var(--tk-surface);
  box-shadow: none;
}
body[data-view="tasks"] .tcard:hover { transform: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09); }
body[data-view="tasks"] .tcard__top { gap: 6px; }
body[data-view="tasks"] .pchip {
  height: 22px;
  padding: 0 10px 0 8px;
  gap: 6px;
  border-radius: var(--r-3);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  color: var(--tk-text);
  background: var(--tk-chip);
}
body[data-view="tasks"] .pchip i { width: 7px; height: 7px; }
body[data-view="tasks"] .hue-0 i { background: #f0a05a; }
body[data-view="tasks"] .hue-1 i { background: #7cc6f5; }
body[data-view="tasks"] .hue-2 i { background: #7ee0a8; }
body[data-view="tasks"] .hue-3 i { background: #c3a6f0; }
body[data-view="tasks"] .hue-4 i { background: #f07a6c; }
body[data-view="tasks"] .hue-0, body[data-view="tasks"] .hue-1, body[data-view="tasks"] .hue-2,
body[data-view="tasks"] .hue-3, body[data-view="tasks"] .hue-4 { background: var(--tk-chip); color: var(--tk-text); }
body[data-view="tasks"] .tcard__title {
  font-size: 15px;
  line-height: 1.32;
  font-weight: 600;
  color: var(--tk-text);
}
body[data-view="tasks"] .tcard__meta { font-size: 12px; color: var(--tk-muted); }
body[data-view="tasks"] .tcard .est { color: var(--tk-muted); border-color: rgba(255, 255, 255, 0.14); }
body[data-view="tasks"] .tcard .due { color: var(--tk-muted); }
body[data-view="tasks"] .tcard__move { color: var(--tk-muted); }
body[data-view="tasks"] .prio-badge { font-size: 10px; }

body[data-view="tasks"] .hint#taskNote { font-size: 12.5px; color: var(--tk-muted); margin-top: 10px; }

@media (max-width: 920px) {
  body[data-view="tasks"] .stage { padding: 10px 16px 96px; }
  body[data-view="tasks"] .pagetitle { font-size: 34px; letter-spacing: -1px; }
  body[data-view="tasks"] #taskSub { font-size: 14.5px; }
  body[data-view="tasks"] .stats--4 { margin-bottom: 16px; }
  body[data-view="tasks"] .filterbar { height: auto; border-radius: var(--r-2); }
  body[data-view="tasks"] .board { height: calc(100dvh - 330px); }
}

body { display: block; background: var(--bg-0); }
.wall {
  background:
    radial-gradient(1100px 640px at 84% -14%, rgba(58, 92, 150, 0.22), transparent 60%),
    radial-gradient(900px 700px at 8% 108%, rgba(40, 60, 100, 0.14), transparent 62%),
    linear-gradient(135deg, #16171a, #101114 55%, #0a0a0c 100%);
}
.wall::before { display: none; }

html[data-glass="on"] .rail,
html[data-glass="on"] .card,
html[data-glass="on"] .panel,
html[data-glass="on"] .taskform,
html[data-glass="on"] .island,
html[data-glass="on"] .tabbar,
html[data-glass="on"] .lens,
html[data-glass="on"] .toast,
html[data-glass="on"] .dlg,
html[data-glass="on"] .drawer,
html[data-glass="on"] .finder__box,
html[data-glass="on"] .bcol,
html[data-glass="on"] .combo__list { backdrop-filter: none; }

/* ---- guscio: rail flottante + toolbar ---- */

.rail {
  position: fixed;
  left: 62px;
  top: 14px;
  bottom: 14px;
  width: 252px;
  height: auto;
  padding: 18px 12px 12px;
  border: 0;
  border-radius: var(--r-3);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  z-index: 30;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.brand { padding: 0 8px 6px; }
.brand__name { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.nav__item { height: 42px; border-radius: var(--r-2); font-size: 14.5px; font-weight: 550; color: var(--ink-2); }
.nav__item[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav__item[aria-current="page"] svg { stroke: var(--ink); }
.lens {
  height: 42px;
  border-radius: var(--r-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.1)), rgba(255, 255, 255, 0.02));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: inset 0 1px 1px color-mix(in srgb, var(--accent) 25%, rgba(255, 255, 255, 0.2));
}
.nav { gap: 3px; }
.lens { transform: translateY(calc(var(--lens-i, 0) * 45px)); }
.railstats { background: rgba(150, 150, 175, 0.08); border: 0; border-radius: var(--r-2); padding: 14px; }
.rail__foot { padding-top: 8px; }

.toolbar {
  position: fixed;
  left: 346px;
  right: 80px;
  top: 14px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  z-index: 25;
  pointer-events: none;
}
.toolbar > * { pointer-events: auto; }
.tsearch {
  flex: 1;
  max-width: 520px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-3);
  background: var(--bg-1);
  color: var(--ink-2);
  font-size: 15px;
}
.tsearch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tsearch kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: var(--r-1); padding: 2px 7px; }
.toolbtn {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-3);
  background: var(--bg-1);
  color: var(--ink-2);
}
.toolbtn:hover { color: var(--ink); }
.toolbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.stage {
  margin-left: 346px;
  margin-right: 80px;
  padding: 14px 0 48px;
  max-width: none;
  width: auto;
}
body[data-view="tasks"] .stage { padding: 14px 0 48px; max-width: none; }

/* ---- testata comune ---- */

.pagehead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "lead lead" "stats actions";
  gap: 18px 32px;
  align-items: center;
  margin-bottom: 24px;
}
.pagehead > div:first-child { grid-area: lead; min-width: 0; }
.pagehead > .stats { grid-area: stats; margin: 0; }
.pagehead .pagehead__actions { grid-area: actions; padding-top: 0; }
.pagetitle {
  font-family: var(--display);
  font-size: 56px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -1.7px;
  color: var(--ink);
}
.pagehead .hint, .pagehead > div > .hint { margin: 8px 0 0; font-size: 17px; font-weight: 500; color: var(--ink-2); }
.pagehead__actions { display: flex; align-items: center; gap: 10px; }
.seg { background: rgba(150, 150, 175, 0.16); border: 0; padding: 3px; height: 40px; }
.seg button { height: 34px; padding: 0 14px; font-size: 14px; font-weight: 600; border-radius: var(--r-3); color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); color: var(--ink); }
.btn--accent { height: 42px; padding: 0 18px; border: 0; border-radius: var(--r-3); font-size: 15px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }

.stats, .stats--4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }

.stat {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-2);
  background: var(--bg-1);
  box-shadow: none;
  gap: 2px;
}
.stat b { font-family: var(--sans); font-size: 23px; line-height: 1.1; font-weight: 700; letter-spacing: -0.46px; color: var(--ink); }
.stat span { order: -1; font-size: 12.5px; line-height: 1.45; font-weight: 560; letter-spacing: 0; text-transform: none; color: var(--ink-2); }

/* ---- card base ---- */

.card, .panel {
  border: 0;
  border-radius: var(--r-3);
  background: var(--bg-1);
  box-shadow: none;
}
.card { padding: 22px; gap: 14px; }
.card__label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.card__title { font-family: var(--display); font-size: 24px; font-weight: 650; letter-spacing: -0.5px; color: var(--ink); }
.sectionTitle { font-size: 15px; font-weight: 650; letter-spacing: -0.1px; text-transform: none; color: var(--ink); }

/* ---- home: griglia a 6 card come Pane ---- */

.home { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.home .groups { gap: 16px; }
.home .group__head h2 { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 650; color: var(--ink); }
.home .row { border-radius: var(--r-2); }
.home .mini { border-radius: var(--r-2); }

@media (max-width: 1200px) {

}

/* ---- progetti: 4 colonne da 348 ---- */

body[data-view="projects"] .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body[data-view="projects"] .card.pcard { padding: 22px; border-radius: var(--r-3); min-height: 297px; grid-template-rows: auto auto 1fr auto; }
body[data-view="projects"] .pcard__desc { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
body[data-view="projects"] .progress { background: rgba(150, 150, 175, 0.1); border-radius: var(--r-2); padding: 12px 16px 12px 12px; }
body[data-view="projects"] .pcard__next { border-top: 0; padding-top: 0; }
body[data-view="projects"] .card__name { font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }

/* ---- team: 4 colonne da 359, card 262 ---- */

body[data-view="team"] .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body[data-view="team"] .card.member { padding: 20px; border-radius: var(--r-3); min-height: 262px; grid-template-rows: auto auto 1fr auto; }
body[data-view="team"] .member__load { background: rgba(150, 150, 175, 0.1); border-radius: var(--r-2); padding: 12px 14px; }
body[data-view="team"] .member__desc { font-size: 12.5px; }

/* ---- calendario: card mese 70% + agenda 25% ---- */

body[data-view="calendar"] .calcard { padding: 18px; border-radius: var(--r-3); }
body[data-view="calendar"] .agenda { padding: 22px; border-radius: var(--r-3); }
body[data-view="calendar"] .calsplit { grid-template-columns: minmax(0, 1fr) 378px; gap: 20px; }
body[data-view="calendar"] .cal__day { height: 92px; border-radius: var(--r-2); }
body[data-view="calendar"] .cal__head { font-size: 10.5px; letter-spacing: 0.02em; }

/* ---- settings: nav 264 + gruppi ---- */

.settings { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 20px; align-items: start; }
.snav { display: grid; gap: 4px; padding: 12px 10px; border-radius: var(--r-3); background: var(--bg-1); position: sticky; top: 88px; }
.snav button { height: 49px; border-radius: var(--r-2); padding: 0 14px; text-align: left; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.snav button[aria-current="true"] { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.settings__col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.scol { display: grid; gap: 20px; align-content: start; min-width: 0; container-type: inline-size; }

.settings__col > .sgroup { grid-column: auto; min-width: 0; }

.sgroup { border-radius: var(--r-3); background: var(--bg-1); padding: 22px 22px 8px; }
.sgroup[data-half="true"] { grid-column: span 1; }
.sgroup__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.sgroup__head h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.2px; }
.sgroup__head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }

@media (max-width: 1200px) {
  body[data-view="projects"] .cards, body[data-view="team"] .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-view="calendar"] .calsplit { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .rail { display: none; }
  .toolbar { left: 16px; right: 16px; top: 10px; height: 48px; }
  .tsearch { max-width: none; height: 48px; }
  .toolbtn { width: 48px; height: 48px; }
  .stage { margin: 0; padding: 70px 16px 110px; }
  .island { top: auto; bottom: 84px; left: 50%; right: auto; transform: translateX(-50%); width: calc(100vw - 32px); }
  .pagetitle { font-size: 34px; letter-spacing: -1px; }
  .pagehead .hint { font-size: 14.5px; }
  .pagehead__actions { padding-top: 0; }
  .home { grid-template-columns: 1fr; }

  body[data-view="projects"] .cards, body[data-view="team"] .cards { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .cell { flex-wrap: wrap; gap: 8px; }
  .cell__note { white-space: normal; text-align: right; }
  .settings__col, .sgroup, .sgroup[data-half="true"] { grid-column: span 1; }
}
/* ---- settings: celle e gruppi ---- */

.sgroup .cells { list-style: none; margin: 0; padding: 0; }
.cell { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.cell:first-child { border-top: 0; }
.cell b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.cell div > span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.cell > b { font-family: var(--mono); font-size: 13px; color: var(--ink-2); font-weight: 500; }
.cell__note { order: 2; font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: var(--r-3); padding: 3px 9px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cell--block { display: grid; align-items: start; }
.cell--block code.block { margin-top: 10px; background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; font-size: 12.5px; }
.swatches button[data-accent-set="blu"] { background: #1f6fe6; }
.swatches button[data-accent-set="verde"] { background: #37d17a; }
.swatches button[data-accent-set="corallo"] { background: #f07a6c; }
.snav button { height: 49px; }
/* ================= rifiniture: bordi, ombre, pinned, scheda persona ================= */

.card, .panel, .bcol, .sgroup, .snav, .filterbar, .stat, .tsearch, .toolbtn, .me {
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.rail, .island, .dlg, .drawer, .finder__box {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 48px -22px rgba(0, 0, 0, 0.85);
}
.tcard { border: 1px solid rgba(255, 255, 255, 0.04); }
.tcard:hover { border-color: rgba(255, 255, 255, 0.1); }
.bcol__count, .pchip, .seg, .me__menu { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.cal__day { border: 1px solid rgba(255, 255, 255, 0.045); }
.cal__day[data-other="true"] { border-color: transparent; }

/* pinned */
.pinned { display: grid; gap: 4px; padding: 4px 4px 0; }
.pinned__label { margin: 6px 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.pinned__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pinned__list button { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 7px 10px; border-radius: var(--r-2); font-size: 13px; color: var(--ink-2); text-align: left; }
.pinned__list button:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.pinned__list i { width: 8px; height: 8px; border-radius: var(--r-1); flex: none; }
.pinned__list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* scheda persona */
.rail__foot { position: relative; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-2); background: rgba(255, 255, 255, 0.03); }
.me:hover { background: rgba(255, 255, 255, 0.06); }
.me__photo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.me__text { display: grid; gap: 1px; text-align: left; min-width: 0; }
.me__text b { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.me__text span { font-size: 11.5px; color: var(--ink-3); }
.me__chev { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); }
.me__menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-2);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  z-index: 20;
}
.me__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }

/* avatar foto nel team e negli elementi con persone */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* ================= insights come Pane ================= */

.insights { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.ins-card { grid-column: span 5; padding: 22px; border-radius: var(--r-3); display: grid; gap: 12px; align-content: start; }
.ins-card--wide { grid-column: span 7; }
.ins-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ins-head h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.1px; }
.ins-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.ins-badge { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: var(--r-3); padding: 3px 9px; white-space: nowrap; }
.ins-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ins-sum { margin: 0; font-size: 13px; color: var(--ink-2); }
.ins-key { list-style: none; display: flex; gap: 14px; margin: 0; padding: 0; font-size: 11.5px; color: var(--ink-3); }
.ins-key i { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-1); margin-right: 5px; }
.k-now { background: var(--accent); }
.k-prev { background: rgba(255, 255, 255, 0.18); }
.chart .bar-now { fill: var(--accent); }
.chart .bar-prev { fill: rgba(255, 255, 255, 0.12); }
.chart .axis { stroke: rgba(255, 255, 255, 0.1); }
.chart text { fill: var(--ink-3); font-size: 10px; }

.stat--kpi { min-width: 140px; }
.stat--kpi .kpi__value { display: flex; align-items: baseline; gap: 8px; }
.stat--kpi .kpi__delta { font-style: normal; font-family: var(--mono); font-size: 11.5px; }
.kpi__delta[data-tone="up"] { color: var(--fresh); }
.kpi__delta[data-tone="down"] { color: var(--bad); }

.load-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 12.5px; border-top: 1px solid var(--line); }
.load-row:first-child { border-top: 0; }
.load-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-val { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.seg--sm { height: 34px; }
.seg--sm button { height: 28px; font-size: 12px; padding: 0 10px; }

.table--ins th { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.table--ins td { font-size: 13px; }

@media (max-width: 1200px) {
  .ins-card, .ins-card--wide { grid-column: span 12; }
}
/* ================= effetti, allineati a Pane ================= */

@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes drawerIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

.dlg[open] { animation: dlgIn 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
.dlg::backdrop { animation: fadeIn 0.2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer:not([hidden]) { animation: drawerIn 0.26s cubic-bezier(0.22, 1, 0.36, 1); }
.me__menu:not([hidden]) { animation: popIn 0.16s cubic-bezier(0.22, 1, 0.36, 1); }
.finder:not([hidden]) .finder__box { animation: dlgIn 0.18s cubic-bezier(0.22, 1, 0.36, 1); }

.card, .tcard, .mcard, .pcard { transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease); }
.card:hover { border-color: rgba(255, 255, 255, 0.11); }
body[data-view="projects"] .pcard:hover, body[data-view="team"] .mcard:hover { transform: translateY(-2px); }
.bcol__list { scroll-behavior: smooth; }
.pinned__list button:active, .nav__item:active { transform: scale(0.99); }
/* ================= settings 1:1 con Pane ================= */

.settings { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 20px; align-items: start; }
.snav {
  display: grid;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  position: sticky;
  top: 20px;
}
.snav__me {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
}
.snav__photo { width: 47px; height: 47px; border-radius: 50%; object-fit: cover; flex: none; }
.snav__me span { display: grid; gap: 2px; min-width: 0; }
.snav__me b { font-size: 15px; font-weight: 650; color: var(--ink); }
.snav__me i { font-style: normal; font-size: 12px; color: var(--ink-3); }
.snav button {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 0 10px;
  border-radius: var(--r-2);
  font-size: 15px;
  font-weight: 620;
  color: var(--ink-2);
  text-align: left;
}
.snav button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.snav button[aria-current="true"] { background: rgba(255, 255, 255, 0.08); color: var(--ink); }

.sicon { width: 28px; height: 28px; border-radius: var(--r-2); display: grid; place-items: center; flex: none; }
.sicon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sicon.hue-blue { background: rgba(31, 111, 230, 0.16); color: #7cb0ff; }
.sicon.hue-green { background: rgba(55, 209, 122, 0.14); color: #6ee2a2; }
.sicon.hue-orange { background: rgba(240, 160, 90, 0.16); color: #f0a05a; }
.sicon.hue-violet { background: rgba(195, 166, 240, 0.16); color: #c3a6f0; }

.settings__col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.scol { display: grid; gap: 20px; align-content: start; min-width: 0; container-type: inline-size; }

.settings__col > .sgroup { grid-column: auto; min-width: 0; }

.sgroup {
  grid-column: span 2;
  padding: 22px 22px 6px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid rgba(255, 255, 255, 0.055);
}
.sgroup__head { display: block; padding: 0 0 10px; }
.sgroup__head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.2px; color: var(--ink); }
.sgroup__head p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.sgroup .cells { list-style: none; margin: 0; padding: 0; }
.cell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.cell:first-child { border-top: 0; }
.cell__main { display: grid; gap: 2px; min-width: 0; }
.cell__main b { font-size: 14px; font-weight: 600; color: var(--ink); }
.cell__main > span { font-size: 12.5px; color: var(--ink-3); }
.cell__ctl { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cell__value { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.cell--block { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
.cell--block code.block { margin-top: 10px; }
.agenda__people { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.pav { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.14); margin-left: -4px; }
.pav:first-child { margin-left: 0; }
.pav--more { display: grid; place-items: center; font-size: 9px; background: rgba(255, 255, 255, 0.1); color: var(--ink-2); }
.agenda__names { margin-left: 6px; font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* pinned: struttura e troncamento */
.pinned { padding: 6px 2px 0; }
.pinned__label { margin: 4px 10px 6px; }
.pinned__list button { align-items: flex-start; gap: 10px; padding: 8px 10px; }
.pinned__list i { margin-top: 5px; width: 7px; height: 7px; border-radius: var(--r-1); }
.pinned__list span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font-size: 12.5px;
  line-height: 1.35;
}
/* ================= team: persone e agenti, profilo 1:1 ================= */

.teamBlock { display: grid; gap: 12px; }
.blockHead { display: flex; align-items: baseline; gap: 10px; padding: 0 2px; }
.blockHead h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.2px; color: var(--ink); }
.cards--people, .cards--agents { grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 20px; }

.mcard {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid rgba(255, 255, 255, 0.055);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.mcard:hover { border-color: rgba(255, 255, 255, 0.11); transform: translateY(-1px); }
.mcard__top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mcard__photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.mcard__id { display: grid; gap: 2px; min-width: 0; flex: 1; }
.mcard__id b { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard__id span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mcard__info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.presence { display: inline-flex; align-items: center; gap: 6px; }
.presence i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.presence[data-status="online"] i { background: #37d17a; }
.presence[data-status="focus"] i { background: #1f6fe6; }
.presence[data-status="meeting"] i { background: #f0a05a; }
.presence[data-status="away"] i { background: var(--ink-3); }
.mcard__where { color: var(--ink-2); }
.mcard__gap { font-size: 11px; color: var(--ink-3); }

.mload { display: grid; gap: 7px; padding: 12px 14px; border-radius: var(--r-2); background: rgba(150, 150, 175, 0.12); }
.mload__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.mload__head b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); }
.mload__bar { height: 8px; border-radius: var(--r-3); background: rgba(150, 150, 175, 0.2); overflow: hidden; }
.mload__bar i { display: block; height: 100%; border-radius: var(--r-3); background: #37d17a; }
.mload[data-load="warn"] .mload__bar i { background: #f0a05a; }
.mload[data-load="bad"] .mload__bar i { background: #f07a6c; }

.mcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mcard__open { font-size: 12px; color: var(--ink-3); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--r-3); }

.avatar--lg { width: 48px; height: 48px; font-size: 15px; }
.avatar--xl { width: 72px; height: 72px; font-size: 22px; }

.pchip.hue-pink { background: rgba(242, 100, 159, 0.16); color: #f2649f; }

/* profilo */
.profile {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(420px, calc(100vw - 28px));
  z-index: 70;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 22px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  animation: profileIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-glass="on"] .profile { background: color-mix(in srgb, var(--bg-1) 92%, transparent); backdrop-filter: blur(28px) saturate(150%); }
@keyframes profileIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.profile__close { position: absolute; top: 12px; right: 14px; width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--ink-3); }
.profile__close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.profile__body { display: grid; gap: 14px; }
.profile__desc { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.pmhead { display: flex; align-items: center; gap: 14px; }
.pmhead__photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.pmhead__id { display: grid; gap: 3px; min-width: 0; }
.pmhead__id h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.6px; color: var(--ink); }
.pmhead__id p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.pmhead__chips { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

.seg--wide { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; border-radius: var(--r-2); }
.seg--wide button { padding: 9px 6px; font-size: 12.5px; text-align: center; }

.pmtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pmtile { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-2); background: rgba(150, 150, 175, 0.12); }
.pmtile span { font-size: 11px; color: var(--ink-3); }
.pmtile b { font-size: 13.5px; font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pmload { display: flex; align-items: center; gap: 18px; padding: 14px 16px; border-radius: var(--r-3); background: rgba(150, 150, 175, 0.12); }
.pmring__wrap { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; }
.pmring { width: 84px; height: 84px; transform: rotate(-90deg); }
.pmring circle { fill: none; stroke-width: 4; }
.pmring .bg { stroke: rgba(150, 150, 175, 0.25); }
.pmring .fg { stroke: #37d17a; stroke-linecap: round; }
.pmring__text { position: absolute; display: grid; place-items: center; gap: 0; }
.pmring__text b { font-size: 17px; font-weight: 700; letter-spacing: -0.4px; }
.pmring__text span { font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.pmrows { display: grid; gap: 6px; flex: 1; }
.pmrows div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.pmrows b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); }

.pmtasks__head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.pmtasks__head h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.pmtasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pmtasks button { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border-radius: var(--r-2); text-align: left; }
.pmtasks button:hover { background: rgba(255, 255, 255, 0.05); }
.psq { width: 24px; height: 24px; border-radius: var(--r-1); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.pmtasks__main { display: grid; gap: 1px; min-width: 0; }
.pmtasks__title { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmtasks__sub { display: flex; gap: 4px; font-size: 10.5px; color: var(--ink-3); overflow: hidden; white-space: nowrap; }

@media (max-width: 1400px) {
  .cards--people, .cards--agents { grid-template-columns: repeat(3, minmax(230px, 1fr)); }
}
@media (max-width: 1000px) {
  .cards--people, .cards--agents { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
  .profile { top: auto; right: 0; left: 0; bottom: 0; width: 100vw; border-radius: var(--r-3) var(--r-3) 0 0; max-height: 88vh; }
}
.mcard__namerow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.you { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: var(--r-1); background: rgba(255, 255, 255, 0.1); color: var(--ink-2); }
/* ================= home: sette card come Pane ================= */

.pagehead--home { align-items: flex-start; }
.stats--home { display: flex; flex-wrap: wrap; gap: 12px; }
.stats--home .stat { width: auto; min-width: 120px; }

.home { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.w-rings, .w-next, .w-focus { grid-column: span 4; }
.w-tasks, .w-projects { grid-column: span 5; }
.w-week, .w-people { grid-column: span 7; }
.w-tasks { grid-column: span 5; }

.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 10px; }
.card__head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.2px; color: var(--ink); }
.card__hint { font-size: 11.5px; color: var(--ink-3); }
.card__more { font-size: 12px; color: var(--ink-2); text-decoration: none; }
.card__more:hover { color: var(--accent); }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; justify-items: center; padding-top: 6px; }
.ring-block { display: grid; justify-items: center; gap: 6px; }
.ring-big { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.ring-big svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring-big circle { fill: none; stroke-width: 6; }
.ring-big .bg { stroke: rgba(150, 150, 175, 0.2); }
.ring-big .fg { stroke-linecap: round; transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-big b { position: absolute; font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.ring-block > span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.07em; }
.ring-block > small { font-size: 12px; color: var(--ink-2); }

.next-list { display: grid; gap: 2px; }
.next-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 6px; border-radius: var(--r-2); text-align: left; width: 100%; }
.next-item:hover { background: rgba(255, 255, 255, 0.04); }
.next-item time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.next-item .t { display: grid; gap: 1px; min-width: 0; }
.next-item .t b { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-item .t span { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.focus { display: grid; gap: 10px; justify-items: stretch; }
.focus__chips { display: flex; gap: 6px; justify-content: center; }
.focus__time { font-family: var(--mono); font-size: 42px; font-weight: 600; letter-spacing: -2px; text-align: center; color: var(--ink); }
.focus__label { text-align: center; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.focus select { width: 100%; font-size: 12px; }

.mytasks { display: grid; gap: 1px; }
.myrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: var(--r-2); }
.myrow:hover { background: rgba(255, 255, 255, 0.04); }
.myrow .t { display: grid; gap: 1px; min-width: 0; }
.mtitle { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.myrow .t span { font-size: 11px; color: var(--ink-3); }

.week__chart .bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 190px; padding-top: 8px; }
.bar-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar-col i { display: block; width: 100%; border-radius: var(--r-1) var(--r-1) 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); min-height: 3px; }
.bar-col span { font-size: 10px; color: var(--ink-3); }

.hprojects { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hproj { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 8px 6px; border-radius: var(--r-2); text-align: left; }
.hproj:hover { background: rgba(255, 255, 255, 0.04); }
.hproj .t { display: grid; gap: 1px; min-width: 0; }
.hproj .t span { font-size: 11px; color: var(--ink-3); }

.people-wrap { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.pfrom { display: grid; justify-items: center; gap: 5px; }
.pfrom img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.12); }
.pfrom span { font-size: 10px; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1400px) {
  .w-rings, .w-next, .w-focus { grid-column: span 6; }
  .w-tasks, .w-week, .w-projects, .w-people { grid-column: span 12; }
}
@media (max-width: 920px) {
  .home { grid-template-columns: 1fr; }
  .w-rings, .w-next, .w-focus, .w-tasks, .w-week, .w-projects, .w-people, .w-queue, .w-pr { grid-column: 1; }
  .people-wrap { grid-template-columns: repeat(4, 1fr); }
}
.focus__chips .chip { border-radius: var(--r-3); padding: 6px 14px; font-size: 12px; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--ink); }
/* ---------- vetro Pane: applicato per ultimo, vince sulle regole precedenti ---------- */

.glass, .rail, .card, .panel, .taskform, .island, .tabbar, .stat, .mcard, .snav,
.calcard, .profile, .dlg, .toast, .pmload, .mload, .bcol, .filterbar {
  background:
    radial-gradient(260px circle at var(--gx, -400px) var(--gy, -400px), var(--glint), transparent 70%),
    linear-gradient(172deg, var(--sheen) 0%, transparent 34%),
    var(--glass);
  border: 0;
  box-shadow: var(--card-shadow);
}

.card::after, .stat::after, .bcol::after { content: none; }
/* ================= seg con pillola scorrevole ================= */

.seg { position: relative; }
.seg__pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: var(--r-3);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), width 0.34s cubic-bezier(0.22, 1, 0.36, 1), height 0.2s var(--ease);
  z-index: 0;
  pointer-events: none;
}
.seg > button { position: relative; z-index: 1; }
.seg.seg--sm button { height: 28px; padding: 0 12px; font-size: 12px; }
.seg.seg--sm { padding: 3px; }

/* ================= card task 1:1 con Pane ================= */

.tcard {
  border-radius: var(--r-2);
  padding: 12px 12px 12px 14px;
  gap: 10px;
  background: color-mix(in srgb, var(--bg-1) 94%, white 3%);
  border: 0;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 24px 48px -22px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.tcard:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 26px 50px -22px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}
.tcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tcard__more {
  width: 24px;
  height: 24px;
  border-radius: var(--r-1);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease);
}
.tcard:hover .tcard__more, .tcard:focus-within .tcard__more { opacity: 1; }
.tcard__more:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.tcard__more svg { width: 16px; height: 16px; fill: currentColor; }
.tcard__title { font-size: 15px; line-height: 1.32; font-weight: 600; margin: 0; color: var(--ink); }
.tcard__foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--ink-3); }
.tcard__foot .due { display: inline-flex; align-items: center; gap: 4px; }
.tcard__foot .due svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tcard__foot .est { margin-left: auto; }
.tcard__foot .prio-badge { margin-left: auto; }
.tcard__foot .est + .prio-badge { margin-left: 6px; }
.tcard__open { text-align: left; }

/* menu della card */
.cardmenu {
  position: fixed;
  z-index: 90;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--r-2);
  background: var(--bg-1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  animation: menuIn 0.16s var(--ease);
}
html[data-glass="on"] .cardmenu { background: color-mix(in srgb, var(--bg-1) 94%, transparent); backdrop-filter: blur(18px); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.cardmenu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-2); font-size: 13px; color: var(--ink-2); text-align: left; }
.cardmenu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.cardmenu button[data-current="true"] { color: var(--ink); }
.cardmenu button[data-current="true"]::after { content: "âœ“"; color: var(--accent); }
.cardmenu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

/* ================= home: le mie task, progetti, team ================= */

.card__head { align-items: flex-start; }
.card__head > div:first-child { display: grid; gap: 2px; }
.card__sub { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.card__tools { display: flex; align-items: center; gap: 8px; }

.mytasks { display: grid; gap: 0; }
.mytask { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.mytask:last-child { border-bottom: 0; }
.mytask__body { display: grid; gap: 3px; min-width: 0; text-align: left; }
.mytask__title { font-size: 14px; font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mytask__meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }

.hprojects { display: grid; }
.hproject { display: grid; grid-template-columns: 32px minmax(0, 1fr) 90px 42px; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.hproject:last-child { border-bottom: 0; }
.hproject__name { display: grid; gap: 1px; min-width: 0; }
.hproject__name b { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hproject__name small { font-size: 11px; color: var(--ink-3); }
.hproject__bar { height: 6px; border-radius: var(--r-3); background: rgba(150, 150, 175, 0.2); overflow: hidden; }
.hproject__bar i { display: block; height: 100%; border-radius: var(--r-3); background: var(--accent); }
.hproject__pct { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); text-align: right; }

.people-list { display: grid; }
.person-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.person-row:last-child { border-bottom: 0; }
.person-row img, .person-row .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.person-row__main { display: grid; gap: 1px; min-width: 0; }
.person-row__main b { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row__main small { font-size: 11px; color: var(--ink-3); }
/* spaziatura della pagina Tasks come Pane */
.view[data-page="tasks"] { gap: 20px; }
.view[data-page="tasks"] #taskStats,
.view[data-page="tasks"] .filterbar,
.view[data-page="tasks"] #taskBoard,
.view[data-page="tasks"] #taskListWrap,
.view[data-page="tasks"] #taskNote { margin: 0; }
.view[data-page="tasks"] .board { margin-top: 0; }
/* il ticket deve leggersi come card anche da fermo */
.bcol { background: var(--bg-1); box-shadow: var(--card-shadow); }
.bcol__list { gap: 10px; }
.tcard { border-radius: var(--r-2); }
.tcard[data-status="done"] .tcard__title,
.tcard[data-status="done"] .tcard__open span { text-decoration: line-through; color: var(--ink-3); }
.tcard[data-status="done"] { opacity: 0.72; }
/* ---------- ticket: superficie chiara sulla colonna scura, come il riferimento ---------- */

.bcol {
  background: rgba(16, 16, 20, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px -22px rgba(0, 0, 0, 0.75);
}
html[data-glass="on"] .bcol { backdrop-filter: blur(22px) saturate(140%); }

.tcard {
  background: #26262b;
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 10px 20px -14px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.tcard:hover {
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 14px 26px -14px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.tcard__top { align-items: center; }
.tcard__foot { min-height: 24px; }
.tcard__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-left: auto; border: 1px solid rgba(255, 255, 255, 0.14); }

.prio-badge[data-p="2"] { background: rgba(240, 185, 92, 0.18); color: #f0b95c; }
.prio-badge[data-p="3"] { background: rgba(240, 122, 108, 0.2); color: #f07a6c; }
.prio-badge[data-p="1"] { background: rgba(255, 255, 255, 0.07); color: var(--ink-3); }
.prio-badge { display: inline-flex; align-items: center; gap: 4px; }
.prio-badge svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* override alla pari: la regola body[data-view="tasks"] .tcard aveva specificita' maggiore
   e rimetteva la card piatta con box-shadow: none */
body[data-view="tasks"] .tcard {
  background: #26262b;
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 10px 20px -14px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
body[data-view="tasks"] .tcard:hover {
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 14px 26px -14px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
body[data-view="tasks"] .tcard[data-status="done"] { opacity: 0.72; }
body[data-view="tasks"] .bcol {
  background: rgba(16, 16, 20, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px -22px rgba(0, 0, 0, 0.75);
}
/* colonne: vetro scuro con sheen, riflesso e bordo conico (non piu' piatte),
   piu' scure dei ticket che restano solidi e chiari */
body[data-view="tasks"] .bcol {
  position: relative;
  background:
    radial-gradient(260px circle at var(--gx, -400px) var(--gy, -400px), var(--glint), transparent 70%),
    linear-gradient(172deg, var(--sheen) 0%, transparent 34%),
    rgba(14, 14, 18, 0.62);
  box-shadow: var(--card-shadow);
  border: 0;
}
.bcol::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 300deg, var(--rim-hi) 0deg, var(--rim-lo) 55deg, transparent 90deg, var(--rim-lo) 140deg, var(--rim-mid) 180deg, var(--rim-lo) 220deg, transparent 270deg, var(--rim-hi) 330deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}
html[data-glass="on"] body[data-view="tasks"] .bcol { backdrop-filter: blur(22px) saturate(150%) brightness(1.02); }
.tcard__top .pchip { max-width: none; flex: 1 1 auto; min-width: 0; }
/* colonne piu' alte e drag in stile Pane */
body[data-view="tasks"] .board { height: calc(100dvh - 296px); min-height: 420px; }
html.dragging, html.dragging * { cursor: grabbing !important; user-select: none !important; }
.drop-line {
  height: 3px;
  margin: 3px 4px;
  border-radius: var(--r-1);
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent);
  animation: dropPulse 0.9s var(--ease) infinite alternate;
}
@keyframes dropPulse { from { opacity: 0.55; } to { opacity: 1; } }
body[data-view="tasks"] .bcol[data-over="true"] {
  background:
    radial-gradient(260px circle at var(--gx, -400px) var(--gy, -400px), var(--glint), transparent 70%),
    linear-gradient(172deg, var(--sheen) 0%, transparent 34%),
    color-mix(in srgb, var(--accent) 10%, rgba(14, 14, 18, 0.62));
}
.tcard.is-dragging { transform: scale(1.02) rotate(1.2deg); opacity: 0.45; }
/* ---------- seg: pillola in vetro come Pane ---------- */

.seg {
  background: rgba(150, 150, 175, 0.16);
  border: 0;
  border-radius: var(--r-3);
  padding: 3px;
  position: relative;
  display: inline-flex;
  align-items: center;
}
.seg__pill {
  background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -2px 5px rgba(255, 255, 255, 0.12),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.3),
    0 8px 18px -8px rgba(0, 0, 0, 0.6);
  border-radius: var(--r-3);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), width 0.34s cubic-bezier(0.22, 1, 0.36, 1), height 0.2s var(--ease);
}
.seg > button {
  position: relative;
  z-index: 1;
  height: 34px;
  padding: 0 14px 0 12px;
  border-radius: var(--r-3);
  font-size: 14px;
  font-weight: 600;
  color: rgba(235, 235, 245, 0.7);
  background: transparent;
  border: 0;
}
.seg > button[aria-pressed="true"] { color: #f5f5f7; }
.seg > button:hover { color: rgba(235, 235, 245, 0.9); }
.seg.seg--sm > button { height: 28px; padding: 0 11px; font-size: 13px; }
/* ---------- dropdown personalizzato (sostituisce i select nativi) ---------- */

.select-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.dd { position: relative; display: inline-flex; }
.dd__btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--glass-2);
  color: var(--ink-2);
  font-size: 12.5px;
}
.dd__btn:hover { color: var(--ink); border-color: var(--line-strong); }
.dd[data-empty="true"] .dd__btn { color: var(--ink-3); }
.dd__btn[aria-expanded="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dd__label { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__chev {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), margin 0.22s var(--ease);
}
.dd__btn[aria-expanded="true"] .dd__chev { transform: rotate(-135deg); margin-top: 3px; }

.dd__menu {
  position: fixed;
  z-index: 90;
  min-width: 230px;
  max-width: min(400px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: var(--r-3);
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  box-shadow: 0 24px 48px -22px rgba(0, 0, 0, 0.75), 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  opacity: 0;
  transform: translateY(-2px) scale(0.992);
  transform-origin: top left;
  transition: opacity 0.14s var(--ease), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-glass="on"] .dd__menu { background: color-mix(in srgb, var(--bg-1) 97%, transparent); backdrop-filter: blur(22px) saturate(140%); }
.dd__menu.is-open { opacity: 1; transform: none; }

.dd__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: var(--r-2);
  font-size: 14.5px;
  font-weight: 560;
  color: var(--ink-2);
  text-align: left;
  outline: none;
  opacity: 0;
  transform: translateY(3px);
}
.dd__menu.is-open .dd__item {
  animation: ddIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i, 0) * 18ms);
}
@keyframes ddIn { to { opacity: 1; transform: none; } }
.dd__item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dd__item:hover, .dd__item:focus { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
.dd__item[aria-selected="true"] { color: var(--ink); }
.dd__check { order: -1; color: var(--accent); font-size: 12px; width: 12px; text-align: center; }

.dlg__form .dd { display: flex; width: 100%; }
.dlg__form .dd__btn { width: 100%; justify-content: space-between; border-radius: var(--r-2); background: var(--glass-2); padding: 9px 11px; font-size: 13px; }
.dlg__form .dd__menu { width: 100%; max-width: none; }

@media (max-width: 920px) {
  .dd__label { max-width: 120px; }
  .dd__menu { min-width: 220px; }
}
/* ---------- barra filtri: stato attivo quando un menu e' aperto ---------- */

.filterbar {
}
body[data-view="tasks"] .filterbar.is-filtering,
.filterbar.is-filtering {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 5%, var(--glass-2));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
    0 18px 44px -24px color-mix(in srgb, var(--accent) 45%, transparent);
}
.filterbar .dd {
  transition: opacity 0.24s var(--ease), filter 0.24s var(--ease);
}
.filterbar.is-filtering .dd:not(.is-open) {
  opacity: 0.5;
  filter: saturate(0.6);
}
.filterbar.is-filtering .dd:not(.is-open) .dd__btn:hover {
  opacity: 1;
}
.filterbar .dd.is-open .dd__btn {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--glass-2));
  color: var(--ink);
}
/* ---------- settings: nav con lente, celle e switch (come Pane) ---------- */

body[data-view="settings"] .stage { max-width: 1360px; }
.settings { grid-template-columns: 272px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings__col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.scol { display: grid; gap: 20px; align-content: start; min-width: 0; container-type: inline-size; }

.sgroup { min-width: 0; }
.snav { position: sticky; top: 90px; }
.cell--note .cell__main, .cell--code .cell__main { grid-column: 1 / -1; }
.cell--note { padding-left: 2px; }

.snav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  align-self: start;
}
.snav__me { order: 0; margin-top: 0; }
.snav__track { position: relative; display: grid; gap: 4px; }
.snav__lens {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 50px;
  border-radius: var(--r-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), inset 0 -1px 1px rgba(255, 255, 255, 0.08), 0 8px 18px -10px rgba(0, 0, 0, 0.6);
  transform: translateY(0);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.snav__item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 50px;
  padding: 0 12px;
  border-radius: var(--r-2);
  font-size: 15px;
  font-weight: 620;
  color: var(--ink-2);
  text-align: left;
}
.snav__item:hover { color: var(--ink); }
.snav__item[aria-current="true"] { color: var(--ink); }
.snav__item .sicon { width: 28px; height: 28px; border-radius: var(--r-2); display: grid; place-items: center; flex: none; }
.snav__item .sicon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.snav__me span { display: grid; gap: 1px; min-width: 0; }
.snav__me b { font-size: 14.5px; font-weight: 620; }
.snav__me small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cell__main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; width: 100%; }
.cell--note .cell__main, .cell--code .cell__main { grid-template-columns: minmax(0, 1fr); }
.cell__text { display: grid; gap: 2px; min-width: 0; }
.cell__text b { font-size: 14.5px; font-weight: 560; }
.cell__text small { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.cell__read { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.cell--note { border-bottom: 0; }
.cell--note .cell__text b { color: var(--ink-2); }
.cell--note .cell__text small { max-width: 62ch; }
.cell--code .cell__main { width: 100%; }

.cell__input {
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px 11px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  width: min(220px, 48%);
  min-width: 0;
}
.cell__input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 6%, var(--glass-2)); }

.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  width: 100%;
  height: 100%;
  border-radius: var(--r-3);
  background: rgba(150, 150, 175, 0.22);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f5f5f7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.swatches--walls { display: flex; gap: 8px; }
.swatches--walls button {
  width: 28px;
  height: 28px;
  border-radius: var(--r-2);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.swatches--walls button[data-wall-set="dusk"] { background: linear-gradient(145deg, #1b2438, #0b0f18 60%, #2a3a2a); }
.swatches--walls button[data-wall-set="moss"] { background: linear-gradient(145deg, #14251c, #0a110d 60%, #2b4433); }
.swatches--walls button[data-wall-set="sand"] { background: linear-gradient(145deg, #2b241a, #14100b 60%, #3d3323); }
.swatches--walls button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 1180px) {
  .settings__col { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .snav { position: static; }
  .snav__item { height: 44px; font-size: 14px; }
  .cell__input { min-width: 0; width: 100%; }
  .cell { grid-template-columns: 28px minmax(0, 1fr); }
}
/* ogni cella: testo sopra, controllo sotto. A destra il testo si comprimeva. */
.cell__main { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cell__ctl { justify-self: end; }
.cell__main:has(.cell__input) .cell__ctl { justify-self: stretch; }
.cell__input { width: 100%; max-width: 340px; }

/* ---------- menu del "+" e pillola di ricerca (come Pane) ---------- */

.popmenu {
  position: fixed;
  z-index: 95;
  min-width: 232px;
  padding: 8px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 48px -22px rgba(0, 0, 0, 0.75), 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.14s var(--ease), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.popmenu.is-open { opacity: 1; transform: none; }
.popmenu button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  border-radius: var(--r-2);
  font-size: 14.5px;
  font-weight: 560;
  color: var(--ink-2);
  text-align: left;
}
.popmenu button:hover, .popmenu button:focus { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); outline: none; }
.popmenu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.tsearch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  min-width: 320px;
  max-width: 426px;
  flex: 1;
  padding: 0 16px;
  border-radius: var(--r-3);
  background: rgba(150, 150, 175, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--ink-2);
  font-size: 14.5px;
}
.tsearch:hover { background: rgba(150, 150, 175, 0.22); color: var(--ink); border-color: rgba(255, 255, 255, 0.12); }
.tsearch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
.tsearch span { flex: 1; text-align: left; }
.tsearch kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--r-1);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-3);
}
/* ---------- toolbar come Pane: una pillola che contiene la pillola ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.toolbar__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3), inset 0 -1px 1px rgba(255, 255, 255, 0.1), 0 24px 48px -22px rgba(0, 0, 0, 0.75);
}
.toolbar__tools .tsearch {
  height: 46px;
  width: 426px;
  max-width: 42vw;
  flex: 0 1 426px;
  border: 0;
  border-radius: var(--r-3);
  background: rgba(150, 150, 175, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
}
.toolbar__tools .tsearch:hover { background: rgba(150, 150, 175, 0.24); }
.toolbar__tools .toolbtn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  position: relative;
}
.toolbar__tools .toolbtn:hover { background: rgba(150, 150, 175, 0.16); color: var(--ink); }
.toolbar__tools .toolbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tbtn__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 0 0 0 2px var(--bg-1);
}

.popmenu--notif { min-width: 300px; max-width: 360px; }
.popmenu--notif .notif__row { display: grid; gap: 2px; }
.popmenu--notif .notif__row small { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.popmenu--notif .notif__empty { padding: 10px; font-size: 13px; color: var(--ink-3); }
.popmenu--notif svg { width: 18px; height: 18px; }

@media (max-width: 920px) {
  .toolbar__tools { width: 100%; }
  .toolbar__tools .tsearch { width: auto; flex: 1 1 auto; max-width: none; }
  .toolbar__tools .tsearch kbd { display: none; }
}
/* nomi agenti e ruoli: niente troncamento a una lettera */
.mcard__id b { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.mcard__id > span { white-space: normal; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mcard--agent .mcard__id b { font-size: 14.5px; }
body .stage { padding-bottom: 96px; }
/* ---------- accesso: pagina, non modale ---------- */

.auth {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: clamp(28px, 6vw, 120px);
  align-items: end;
  padding: 0 clamp(24px, 7vw, 96px) clamp(40px, 7vh, 88px);
  background: var(--bg-0);
}

.auth__scrim {
  display: none;
}

.auth__aside { position: relative; display: grid; gap: 18px; max-width: 620px; align-self: center; }
.auth__aside::before { content: ""; width: 64px; height: 2px; background: var(--accent); margin-bottom: 6px; }
.auth__brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink-2); }
.auth__brand .mark { width: 22px; height: 22px; }
.auth__brand b { color: var(--accent-text); font-family: var(--mono); font-size: 11px; }
.auth__claim {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 104px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.auth__note { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-3); max-width: 44ch; }

.auth__card {
  position: relative;
  width: 100%;
  padding: 0;
  display: grid;
  gap: 16px;
  background: none;
  border: 0;
  box-shadow: none;
  align-self: end;
}
.auth__title {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.auth__field { display: grid; gap: 7px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); }
.auth__field input {
  height: 44px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0 2px;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  text-transform: none;
  letter-spacing: 0;
  outline: none;
}
.auth__field input:focus {
  border-bottom-color: var(--accent);
}
.auth__submit { height: 48px; justify-content: center; font-size: 14.5px; border-radius: var(--r-2); }
.auth__submit[disabled] { opacity: 0.6; cursor: default; }
.auth__error { margin: 0; font-size: 12.5px; color: var(--bad); }
.auth__fine { margin: 2px 0 0; font-size: 11px; color: var(--ink-3); text-align: center; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; padding: 22px; gap: 16px; align-content: center; }
  .auth__aside { order: 1; gap: 6px; }
  .auth__card { order: 2; padding: 24px 22px 20px; }
  .auth__claim { font-size: 30px; line-height: 1.02; }
  .auth__note { display: none; }
  .auth__brand { font-size: 13px; }
}

body[data-hold="1"] { overflow: hidden; }
/* ---------- utenti e ruoli (solo admin) ---------- */

.sgroup--wide { margin-top: 20px; width: 100%; }
.sgroup--wide .users { max-width: 760px; }
.users { display: grid; gap: 16px; padding: 4px 0 18px; }
.utable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.utable th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 500; padding: 0 10px 8px; }
.utable td { padding: 9px 10px; border-top: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.utable tr:first-child td { border-top: 0; }
.urole {
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 6px 9px;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}
.uact { text-align: right; }
.ubtn { font-size: 12px; padding: 5px 10px; color: var(--ink-3); }
.ubtn:hover { color: var(--bad); }
.userform { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 130px auto; gap: 8px; }
.userform input, .userform select {
  height: 40px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.userform input:focus, .userform select:focus { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.userform .btn { height: 40px; justify-content: center; }

@media (max-width: 760px) {
  .userform { grid-template-columns: 1fr; }
}
/* il gruppo utenti vive fuori dalla griglia delle due colonne: non deve crearne una */
.view > .sgroup--wide { grid-column: auto; }
/* ---------- card "In coda" in Home ---------- */

.w-queue { grid-column: span 12; }
.queue { display: grid; gap: 2px; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); }
.qrow:first-child { border-top: 0; }
.qrow:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.qrow__main { min-width: 0; display: grid; gap: 3px; }
.qrow__title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.qrow__meta .src { font-family: var(--mono); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.qrow__why { display: flex; flex-wrap: wrap; gap: 5px; }
.qrow__why span { font-size: 10px; padding: 1px 6px; border-radius: var(--r-3); border: 1px solid var(--line); color: var(--ink-3); }
.qrow__actions { display: flex; gap: 6px; align-items: center; }
.qrow__actions .btn { padding: 5px 9px; font-size: 11.5px; border-radius: var(--r-2); }
.qempty { padding: 14px 4px; color: var(--ink-3); font-size: 13px; }

@media (max-width: 760px) {
  .qrow { grid-template-columns: 1fr; gap: 8px; }
  .qrow__actions { justify-content: flex-start; flex-wrap: wrap; }
  .qrow__meta .src { max-width: 100%; }
}
/* ---------- schermata di accesso: aiuto e Ricorda ---------- */

.auth__hint { font-size: 11.5px; color: var(--ink-3); margin-top: -2px; }
.auth__remember {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.auth__remember input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth__remember small { flex-basis: 100%; margin-left: 25px; font-size: 11px; color: var(--ink-3); }
/* ---------- card: una sola semantica di colore (priorita) ---------- */

.tcard { border-left: 3px solid transparent; }
.tcard[data-priority="1"] { border-left-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.tcard[data-priority="2"] { border-left-color: color-mix(in srgb, var(--accent) 62%, transparent); }
.tcard[data-priority="3"] { border-left-color: var(--accent); }
.tcard[data-status="done"] { border-left-color: color-mix(in srgb, var(--ink) 14%, transparent); }

.pchip { background: none; border: 1px solid var(--line); color: var(--ink-2); }
.pchip i { display: none; }

.prio-badge { background: none; border: 1px solid var(--line); color: var(--ink-2); }
.prio-badge[data-p] { color: var(--ink-2); }
.late-badge { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }

/* importato: tratteggio, non barrato */
.sourcebadge { border-style: dashed; border-color: var(--line-strong); color: var(--ink-3); }
.tcard[data-status="done"] .tcard__title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }
/* ---------- statistiche con confronto ---------- */

.stat__extra { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stat__extra--row { display: flex; align-items: flex-end; gap: 8px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.spark i { display: block; width: 3px; background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 1px; }
/* ---------- insights: grafici ---------- */

.chart svg { width: 100%; height: 210px; display: block; }
.chart .grid { stroke: color-mix(in srgb, var(--ink) 8%, transparent); stroke-width: 1; }
.chart .axis-line { stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.chart .bar-now { fill: var(--accent); }
.chart .bar-prev { fill: color-mix(in srgb, var(--ink) 22%, transparent); }
.chart .area { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.chart .area-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }

.ins-bar { display: block; height: 8px; border-radius: var(--r-1); background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; min-width: 80px; }
.ins-bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-1); }
.table--ins td { vertical-align: middle; }

.ins-load { display: grid; gap: 10px; }
.ins-load-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.ins-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--glass-2); }
.ins-load-main { display: grid; gap: 5px; min-width: 0; }
.ins-load-name { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-load-track { display: block; height: 6px; border-radius: var(--r-1); background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.ins-load-track i { display: block; height: 100%; background: var(--accent); }
.ins-load-track i.over { background: var(--bad); }
.ins-load-val { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* ---------- accesso: rifiniture ---------- */

.auth { align-items: center; }
.auth__brand svg { width: 22px; height: 22px; fill: var(--accent); }
.auth__claim { font-size: clamp(44px, 11vw, 104px); }

.auth__remember {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.auth__remember input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.auth__remember small { flex-basis: 100%; margin-left: 24px; font-size: 11px; color: var(--ink-3); }

.auth__field .auth__hint { text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--ink-3); margin-top: -2px; }
/* ---------- accesso: pelle dell'app (wallpaper, grana, vetro) ---------- */

.auth { background: var(--bg-0); isolation: isolate; }
.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(920px 640px at 80% -12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    radial-gradient(780px 640px at 4% 108%, rgba(60, 190, 168, 0.16), transparent 64%),
    linear-gradient(158deg, color-mix(in srgb, var(--bg-1) 80%, #000) 0%, var(--bg-0) 62%);
}
.auth::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth > * { position: relative; z-index: 1; }

.auth__card {
  padding: 26px 24px;
  border-radius: var(--r-3);
  gap: 15px;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 46%),
    var(--glass-2);
  border-color: rgba(255, 255, 255, 0.09);
}
.auth__card .auth__title { margin-top: 2px; }
.auth__submit { margin-top: 4px; }

@media (max-width: 920px) {
  .auth__card { padding: 22px 18px; }
}
/* ---------- avvio: nessun flash della shell prima della decisione di auth ----------
   Il markup della Home vive nel documento e veniva dipinto subito, mentre boot()
   risolve la sessione dopo /api/auth/state e /api/auth/me: per una o due round-trip
   si vedeva "La tua coda". Ora il default e `pending`: si vede solo #boot, e la
   shell compare quando lo stato diventa `app`. `visibility` non toglie il layout,
   quindi l'overlay di auth resta posizionato come prima. */
body[data-auth="pending"] > :not(#boot):not(.wall):not(#authScreen),
body[data-auth="auth"] > :not(#authScreen):not(.wall):not(#boot) {
  visibility: hidden;
}
#boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--bg-0);
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.06em;
}
body[data-auth="auth"] #boot,
body[data-auth="app"] #boot { display: none; }
.boot-fallback { margin: 0; padding: 24px; font-size: 14px; color: var(--ink-2); }

/* --- ticket: chiave, avatar iniziali, dialog intake --- */
.tkey { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: .04em; color: var(--ink-3); }
.tcard__avatar--ini { display: grid; place-items: center; background: var(--glass-2); color: var(--ink-2); font-family: var(--display); font-size: 10px; font-weight: 600; }
.dlg--intake { width: min(560px, calc(100vw - 32px)); }
.dlg__form textarea { background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 9px 11px; color: var(--ink); font: inherit; font-size: 13px; resize: vertical; min-height: 120px; }
.dlg__form label.checkline { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink-2); }
.dlg__form label.checkline input { width: auto; margin: 0; }
/* --- Il mio team live --- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; vertical-align: middle; background: var(--ink-3); margin-left: 6px; }
.live-dot[data-state="on"] { background: var(--fresh); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fresh) 18%, transparent); }
.liveagents { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.livecard { padding: 14px; display: grid; gap: 10px; align-content: start; }
.livecounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.livecount { display: grid; gap: 1px; padding: 6px 8px; border-radius: var(--r-2); background: var(--glass-2); border: 1px solid var(--line); }
.livecount b { font-family: var(--mono); font-size: 16px; line-height: 1.2; color: var(--ink); }
.livecount small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.livecount[data-state="doing"] b { color: var(--accent); }
.livecurrent { text-align: left; padding: 10px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--glass-2); display: grid; gap: 3px; }
.livecurrent:hover { border-color: var(--line-strong); }
.livecurrent__key { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.livecurrent__title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.livecurrent small { font-size: 11px; color: var(--ink-3); }
.livecurrent em, .livefeed__row em { font-style: normal; font-size: 11px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.livefree { margin: 0; }
.livefeed { display: grid; gap: 6px; }
.livefeed__row { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--glass-2); }
.livefeed__row:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--accent) 7%, var(--glass-2)); }
.livefeed__key { font-family: var(--mono); font-size: 10px; color: var(--ink-3); min-width: 78px; padding-top: 2px; }
.livefeed__main { display: grid; gap: 3px; min-width: 0; }
.livefeed__main b { font-size: 13px; font-weight: 600; color: var(--ink); }
.livefeed__main small { font-size: 11px; color: var(--ink-3); }
.promptbox { margin: 0; padding: 12px; border-radius: var(--r-2); background: var(--glass-2); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; color: var(--ink-2); }
.tickethistory { display: grid; gap: 2px; }
.tickethistory__row { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 11.5px; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.tickethistory__time { font-family: var(--mono); font-size: 10px; color: var(--ink-3); min-width: 70px; }
.tickethistory__actor { color: var(--ink-3); }
@media (max-width: 920px) { .liveagents { grid-template-columns: 1fr; } .livecounts { grid-template-columns: repeat(2, 1fr); } }
.avatar--img { object-fit: cover; background: var(--glass-2); }
@media (max-width: 560px) {
  .toolbar__tools { gap: 2px; }
  .toolbar__tools .toolbtn { width: 40px; height: 40px; }
  .toolbar__tools .tsearch { min-width: 0; flex: 1 1 100px; overflow: hidden; }
}
.livecard .mcard__top { flex-wrap: wrap; row-gap: 6px; }
.livecard .mcard__id { min-width: 0; }
.livecard .presence { margin-left: auto; }
.livecount { min-width: 0; }
.livecount small { white-space: normal; overflow-wrap: anywhere; }
.livecurrent__title, .livefeed__main b { overflow-wrap: anywhere; }
/* --- archivio sprint --- */
.sprintgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sprintcard { text-align: left; padding: 14px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--glass-2); display: grid; gap: 8px; }
.sprintcard:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--accent) 7%, var(--glass-2)); }
.sprintcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sprintcard__label { font-family: var(--display); font-size: 18px; color: var(--ink); }
.sprintcard__state { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.sprintcard__range { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.sprintcard__counts { display: flex; gap: 18px; }
.sprintcard__counts span { display: grid; gap: 1px; }
.sprintcard__counts b { font-family: var(--mono); font-size: 16px; color: var(--ink); }
.sprintcard__counts small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.dlg--sprint { width: min(680px, calc(100vw - 32px)); max-height: min(80vh, 720px); }
.dlg--sprint .dlg__form { max-height: inherit; overflow: auto; }
.sprinttickets { display: grid; gap: 6px; }
.sprintticket { display: grid; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--glass-2); }
.sprintticket:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--accent) 7%, var(--glass-2)); }
.sprintticket__head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.sprintticket__key { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.sprintticket__head b { font-size: 13px; color: var(--ink); }
.sprintticket__head small { font-size: 10px; color: var(--ink-3); }
.sprintticket__resolution { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
/* --- pull request --- */
.pagehead--pr { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "stats"; }
.stats--pr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.w-pr { grid-column: span 12; }
.prsummary { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.prsummary__counts { display: flex; gap: 18px; flex-wrap: wrap; }
.prsummary__counts span { display: grid; gap: 1px; }
.prsummary__counts b { font-family: var(--mono); font-size: 17px; line-height: 1.2; color: var(--ink); }
.prsummary__counts small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.prsummary__list { flex: 1 1 320px; min-width: 0; display: grid; }
.prsummary__row { display: flex; gap: 8px; align-items: center; width: 100%; min-width: 0; text-align: left; padding: 6px 0; border: 0; border-bottom: 1px solid var(--line); background: none; }
.prsummary__row:last-child { border-bottom: 0; }
.prsummary__title { min-width: 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.prbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; }
.prbar .hint { flex: 1 1 220px; min-width: 0; }
.prbar #prRefresh { margin-left: auto; }
.hint[data-tone="bad"] { color: var(--bad); }
.prlist { display: grid; gap: 8px; }
.prrow { display: grid; gap: 6px; width: 100%; min-width: 0; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--glass-2); }
.prrow:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--accent) 7%, var(--glass-2)); }
.prrow__top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.prrow__num { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.prrow__title { flex: 1 1 220px; min-width: 0; font-size: 13.5px; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.prrow__meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); }
.prreason { font-size: 11.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.prbadge { flex: 0 0 auto; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.prbadge[data-decision="pending"] { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prbadge[data-decision="accepted"] { color: var(--fresh); border-color: color-mix(in srgb, var(--fresh) 40%, transparent); }
.prbadge[data-decision="denied"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.dlg--pr { width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 720px); }
.dlg--pr .dlg__form { max-height: inherit; overflow: auto; }
.prdialog__reason { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; color: var(--ink); padding: 12px; border-radius: var(--r-2); background: var(--glass-2); border: 1px solid var(--line); }
@media (max-width: 920px) {
  .stats--pr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-pr { grid-column: 1; }
  .prbar { align-items: flex-start; }
  .prsummary__counts { width: 100%; justify-content: space-between; }
}
@media (max-width: 560px) {
  .prrow__title { flex-basis: 100%; }
}
/* --- grafico Settimana: barre proporzionate, valori e griglia --- */
.weekchart { display: grid; gap: 10px; min-width: 0; }
.weekchart .bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  height: 150px;
  padding: 18px 0 0;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 33.333%;
  background-position: bottom;
}
.weekchart .bar-col { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; align-items: end; gap: 6px; height: 100%; min-width: 0; }
.weekchart .bar-val { font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--ink-2); }
.weekchart .bar-val[data-zero="true"] { color: var(--ink-3); }
.weekchart .bar-track { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; min-height: 2px; }
.weekchart .bar-fill { display: block; width: 100%; max-width: 64px; min-height: 2px; border-radius: var(--r-1) var(--r-1) 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); }
.weekchart .bar-fill.is-zero { height: 2px !important; background: var(--line-strong); border-radius: 2px; }
.weekchart .bar-col[data-today="true"] .bar-fill:not(.is-zero) { filter: saturate(1.15) brightness(1.08); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.weekchart .bar-day { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.weekchart .bar-col[data-today="true"] .bar-day { color: var(--accent-text); font-weight: 650; }
.weekchart__foot { margin: 0; font-size: 11px; color: var(--ink-3); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .weekchart .bars { gap: 6px; height: 136px; }
  .weekchart .bar-fill { max-width: none; }
}
/* La card Settimana riempie la riga: il grafico usa l'altezza disponibile. */
.w-week { display: flex; flex-direction: column; }
.w-week #homeWeek { flex: 1 1 auto; min-height: 0; display: flex; }
.w-week .weekchart { flex: 1; width: 100%; grid-template-rows: minmax(0, 1fr) auto; }
.w-week .weekchart .bars { height: 100%; min-height: 150px; }
/* Home su telefono: titolo, azioni, statistiche a 2 colonne. Nessun cambio di stile. */
@media (max-width: 920px) {
  .pagehead--home { grid-template-columns: 1fr; grid-template-areas: "lead" "actions" "stats"; gap: 12px; }
  .pagehead--home .pagehead__actions { grid-area: actions; justify-content: flex-start; flex-wrap: wrap; }
  .pagehead--home .stats { grid-area: stats; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Card PR in Home su telefono: contatori sopra, elenco a tutta larghezza. */
@media (max-width: 920px) {
  .prsummary { display: grid; gap: 10px; }
  .prsummary__counts { width: auto; justify-content: flex-start; }
  .prsummary__list { width: 100%; flex: none; }
}
/* Home: a telefono ogni card occupa l'intera colonna, anche se una regola base dice span 12. */
@media (max-width: 920px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home > .card { grid-column: 1 / -1; }
}