/* Centro di Costo — Console di amministrazione */
:root {
  --bg: #f4f5f8; --panel: #ffffff; --panel2: #f8f9fb; --ink: #0f1626; --ink2: #3a4458; --mut: #6b7488; --line: #e5e8ef; --line2: #eef0f4;
  --acc: #3362ab; --acc2: #4f86d6; --accs: rgba(51, 98, 171, .09); --ok: #138a63; --oks: rgba(19, 138, 99, .1); --warn: #b9740c; --warns: rgba(217, 138, 20, .12); --bad: #c93a52; --bads: rgba(201, 58, 82, .1);
  --side: #0b1020; --side2: #121a30; --sidei: #c9d2e6; --sidem: #7d89a6;
  --sh1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04); --sh2: 0 12px 32px -8px rgba(16, 24, 40, .16), 0 4px 10px -4px rgba(16, 24, 40, .08); --sh3: 0 30px 80px -20px rgba(10, 18, 40, .35);
  --r: 14px; --r2: 10px; --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.4, .5, 1);
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0a0e17; --panel: #111725; --panel2: #151c2c; --ink: #e9edf5; --ink2: #c3cad8; --mut: #8b95ab; --line: #1f2839; --line2: #192131;
  --acc: #5b8fe0; --acc2: #7aa6ec; --accs: rgba(91, 143, 224, .13); --ok: #34c08e; --oks: rgba(52, 192, 142, .12); --warn: #e8a640; --warns: rgba(232, 166, 64, .13); --bad: #ef6b80; --bads: rgba(239, 107, 128, .12);
  --side: #070a12; --side2: #0f1525; --sh1: 0 1px 2px rgba(0, 0, 0, .3); --sh2: 0 14px 36px -10px rgba(0, 0, 0, .6); --sh3: 0 30px 80px -20px rgba(0, 0, 0, .7); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0a0e17; --panel: #111725; --panel2: #151c2c; --ink: #e9edf5; --ink2: #c3cad8; --mut: #8b95ab; --line: #1f2839; --line2: #192131;
  --acc: #5b8fe0; --acc2: #7aa6ec; --accs: rgba(91, 143, 224, .13); --ok: #34c08e; --oks: rgba(52, 192, 142, .12); --warn: #e8a640; --warns: rgba(232, 166, 64, .13); --bad: #ef6b80; --bads: rgba(239, 107, 128, .12);
  --side: #070a12; --side2: #0f1525; --sh1: 0 1px 2px rgba(0, 0, 0, .3); --sh2: 0 14px 36px -10px rgba(0, 0, 0, .6); --sh3: 0 30px 80px -20px rgba(0, 0, 0, .7); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
svg.i, .btn svg, .ib svg, .side-nav svg, .side-ext svg, .search svg, .filter svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--mut); } .small { font-size: 12.5px; } .pad { padding: 6px 2px; } .foot { margin: 14px 2px 0; }
.mono { font-family: var(--mono); letter-spacing: .02em; } .up { text-transform: uppercase; }
.link:hover { color: var(--acc); }

/* ---------- pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .15s; box-shadow: var(--sh1); }
.btn:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--mut)); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--acc) 70%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--acc) 88%, #000); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--panel2); border-color: var(--line); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.loading span { opacity: 0; } .btn.loading { position: relative; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.ib { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--mut); transition: background .15s, color .15s; }
.ib:hover { background: var(--panel2); color: var(--ink); }
.ib.sm { width: 30px; height: 30px; } .ib.sm svg { width: 16px; height: 16px; }
.spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--acc) 25%, transparent); border-top-color: var(--acc); animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- campi ---------- */
.fl { display: grid; gap: 6px; margin: 0 0 13px; min-width: 0; }
.fl > span { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.fl input, .fl select, .fl textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14px; }
.fl textarea { height: auto; padding: 10px 12px; resize: vertical; }
.fl input:focus, .fl select:focus, .fl textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 4px var(--accs); }
.fl input:disabled { background: var(--panel2); color: var(--mut); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .row.three { grid-template-columns: repeat(3, 1fr); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--acc); flex: none; }
.check.big { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.check span { display: grid; gap: 2px; } .check small { color: var(--mut); font-weight: 400; }
/* interruttore */
.sw { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: color-mix(in srgb, var(--mut) 35%, var(--line)); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--spring); }
.sw:checked { background: var(--acc); } .sw:checked::after { transform: translateX(18px); }
.sw:focus-visible { outline: 3px solid var(--accs); }
/* scelte segmentate */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.seg-o { position: relative; cursor: pointer; }
.seg-o input { position: absolute; opacity: 0; }
.seg-o span { display: grid; gap: 1px; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--panel); transition: border-color .15s, background .15s, box-shadow .15s; }
.seg-o b { font-size: 13.5px; } .seg-o small { color: var(--mut); font-size: 12px; }
.seg-o input:checked + span { border-color: var(--acc); background: var(--accs); box-shadow: 0 0 0 3px var(--accs); }
.seg-o.bloccato input:checked + span { border-color: var(--bad); background: var(--bads); box-shadow: 0 0 0 3px var(--bads); }
.seg-o input:focus-visible + span { outline: 2px solid var(--acc); }
.segm { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.segm button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--mut); }
.segm button.on { background: var(--panel); color: var(--ink); box-shadow: var(--sh1); }

/* ---------- pillole e stati ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--panel2); color: var(--ink2); border: 1px solid var(--line); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill.ok { background: var(--oks); color: var(--ok); border-color: transparent; } .pill.warn { background: var(--warns); color: var(--warn); border-color: transparent; } .pill.bad { background: var(--bads); color: var(--bad); border-color: transparent; }
.pill.p-pro { background: linear-gradient(135deg, #2b4f8f, #5a3fa8); color: #fff; border-color: transparent; } .pill.p-base { background: var(--accs); color: var(--acc); border-color: transparent; } .pill.p-prova { background: var(--warns); color: var(--warn); border-color: transparent; }
.pill.r-lettura { background: var(--panel2); } .pill.r-admin { background: var(--side); color: #fff; border-color: transparent; } .pill.lim { background: var(--warns); color: var(--warn); border-color: transparent; }
.pill.code { cursor: pointer; font-family: var(--mono); } .pill.code:hover { border-color: var(--acc); color: var(--acc); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.st-on { color: var(--ok); } .st-soon { color: var(--warn); } .st-late { color: var(--bad); } .st-off { color: var(--mut); }
.st-on i { animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 0%, transparent); } }
.late { color: var(--bad); } .soon { color: var(--warn); }
.live { color: var(--ok); font-weight: 600; }
.you { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--accs); color: var(--acc); margin-left: 4px; vertical-align: 1px; }
.av { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, color-mix(in srgb, var(--acc) 22%, var(--panel)), color-mix(in srgb, var(--acc) 8%, var(--panel))); color: var(--acc); font-weight: 700; font-size: 13px; flex: none; position: relative; letter-spacing: .02em; }
.av.on::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.av.sm { width: 32px; height: 32px; font-size: 11.5px; } .av.xs { width: 26px; height: 26px; font-size: 10px; border: 2px solid var(--panel); } .av.lg { width: 58px; height: 58px; font-size: 19px; }
.av.more { background: var(--panel2); color: var(--mut); }
.tile { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent); }
.tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile.sm { width: 34px; height: 34px; border-radius: 10px; } .tile.sm svg { width: 18px; height: 18px; }
.tile.xs { width: 24px; height: 24px; border-radius: 7px; } .tile.xs svg { width: 14px; height: 14px; }
.tile.lg { width: 58px; height: 58px; border-radius: 16px; } .tile.lg svg { width: 30px; height: 30px; }
.tile.xl { width: 84px; height: 84px; border-radius: 24px; } .tile.xl svg { width: 42px; height: 42px; }

/* ---------- accesso ---------- */
.gate { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--side); color: #fff; overflow: auto; }
.gate-art { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(1200px 700px at 30% 40%, #172648 0%, #0b1020 60%); }
.gate-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%); }
#orbit { width: min(88%, 620px); height: auto; position: relative; }
.o-ring { fill: none; stroke: rgba(160, 185, 235, .16); stroke-width: 1; stroke-dasharray: 2 7; animation: ringin 1.4s var(--ease) both; animation-delay: calc(var(--i) * 140ms); transform-origin: 300px 300px; }
@keyframes ringin { from { opacity: 0; transform: scale(.7); } }
.o-glow { animation: glow 4s ease-in-out infinite; transform-origin: 300px 300px; } @keyframes glow { 50% { opacity: .6; transform: scale(1.08); } }
.o-hub-b { fill: #3362ab; filter: drop-shadow(0 10px 30px rgba(51, 98, 171, .6)); }
.o-pulse { fill: none; stroke: #4f86d6; stroke-width: 1.5; transform-origin: 300px 300px; animation: pulse 3s ease-out infinite; } .o-pulse.d2 { animation-delay: 1.5s; }
@keyframes pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(2.6); opacity: 0; } }
.o-link { stroke: rgba(130, 165, 230, .14); stroke-width: 1; }
.o-pkt { fill: #8fb6f5; }
.o-node > circle { fill: #121b31; stroke: color-mix(in srgb, var(--c) 70%, #fff 0%); stroke-width: 1.4; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }
.o-node path, .o-node circle:not(:first-child), .o-node rect { fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.o-node { animation: nodein .9s var(--spring) both; animation-delay: calc(300ms + var(--i) * 70ms); }
@keyframes nodein { from { opacity: 0; } }
.gate-art::after { content: ''; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(11, 16, 32, .92)); pointer-events: none; }
.gate-claim { z-index: 1; position: absolute; left: 48px; bottom: 44px; display: grid; gap: 6px; max-width: 420px; animation: up .9s .5s var(--ease) both; }
.gate-claim b { font-size: 28px; letter-spacing: -.02em; } .gate-claim span { color: #9aa7c4; font-size: 15px; }
.gate-box { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); color: var(--ink); }
.gate-card { width: min(380px, 100%); display: grid; animation: up .7s var(--ease) both; }
.gate-logo { border-radius: 14px; box-shadow: var(--sh2); margin-bottom: 18px; }
.gate-card h1 { font-size: 30px; letter-spacing: -.025em; }
.gate-sub { color: var(--mut); margin: 4px 0 26px; }
.gate-card .btn { margin-top: 6px; }
.gate-err { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--bads); color: var(--bad); font-weight: 500; font-size: 13px; }
.gate-alt { justify-self: center; margin-top: 18px; color: var(--mut); font-size: 13px; } .gate-alt:hover { color: var(--acc); }
.shake { animation: shake .45s; } @keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }

/* ---------- struttura ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; height: 100%; }
.side { background: var(--side); color: var(--sidei); display: flex; flex-direction: column; padding: 18px 12px 12px; min-height: 0; position: relative; overflow: hidden; }
.side::before { content: ''; position: absolute; inset: -40% -60% auto auto; width: 340px; height: 340px; background: radial-gradient(circle, rgba(79, 134, 214, .22), transparent 70%); pointer-events: none; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; position: relative; }
.side-brand img { border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.side-brand div { display: grid; line-height: 1.2; } .side-brand b { color: #fff; font-size: 15.5px; } .side-brand span { color: var(--sidem); font-size: 12px; }
.side-nav { display: grid; gap: 2px; position: relative; }
.side-nav a, .side-ext { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--sidei); font-weight: 500; transition: background .15s, color .15s; position: relative; }
.side-nav a:hover, .side-ext:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-nav a.on { background: linear-gradient(90deg, rgba(79, 134, 214, .22), rgba(79, 134, 214, .06)); color: #fff; }
.side-nav a.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #6fa0ea; animation: barin .3s var(--ease); }
@keyframes barin { from { transform: scaleY(0); } }
.side-nav a.on svg { color: #8fb6f5; }
.side-nav em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--sidei); }
.side-nav em:empty { display: none; } .side-nav em.warn { background: rgba(232, 166, 64, .2); color: #f1bb62; } .side-nav em.live { background: rgba(52, 192, 142, .18); color: #4fd6a4; }
.side-nav em.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 4px; animation: blink 1.6s infinite; display: inline-block; }
.side-nav em.live { display: inline-flex; align-items: center; }
@keyframes blink { 50% { opacity: .3; } }
.side-ext { margin-top: auto; color: var(--sidem); font-size: 13px; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-me .av { background: rgba(255, 255, 255, .08); color: #fff; }
.side-me div { display: grid; min-width: 0; flex: 1; line-height: 1.3; } .side-me b { color: #fff; font-size: 13px; } .side-me span { color: var(--sidem); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me .ib { color: var(--sidem); } .side-me .ib:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); position: relative; z-index: 5; }
.top .menu { display: none; }
.top-t { display: grid; min-width: 0; flex: 1; } .top-t h2 { font-size: 21px; letter-spacing: -.02em; } .top-t span { color: var(--mut); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-t span::first-letter { text-transform: uppercase; }
.search { position: relative; display: flex; align-items: center; gap: 8px; width: 290px; height: 38px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--mut); transition: border-color .15s, box-shadow .15s, width .3s var(--ease); }
.search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--accs); width: 340px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); height: 100%; }
.search kbd { font: 600 11px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--mut); }
.search-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh2); padding: 6px; z-index: 30; animation: pop .18s var(--ease); max-height: 70vh; overflow: auto; }
.search-res small { display: block; padding: 6px 8px 3px; color: var(--mut); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.search-res a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--ink); }
.search-res a:hover { background: var(--panel2); }
.search-res a span { display: grid; min-width: 0; } .search-res em { font-style: normal; color: var(--mut); font-size: 12px; }
.search-res p { margin: 8px; color: var(--mut); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.sync { width: 10px; height: 10px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--mut); }
.sync.ok i { background: var(--ok); } .sync.err i { background: var(--bad); } .sync.old i { background: var(--warn); }
.sync.busy i { background: var(--acc); animation: blink .8s infinite; }
.view { flex: 1; overflow: auto; padding: 24px 28px 48px; scroll-behavior: auto; }
.view > *, .view .stag > *, .view .card { animation: up .55s var(--ease) both; }
.view .stag > * { animation-delay: calc(var(--i, 0) * 50ms); }
.view .stag > :nth-child(1) { --i: 0; } .view .stag > :nth-child(2) { --i: 1; } .view .stag > :nth-child(3) { --i: 2; } .view .stag > :nth-child(4) { --i: 3; } .view .stag > :nth-child(5) { --i: 4; } .view .stag > :nth-child(6) { --i: 5; } .view .stag > :nth-child(7) { --i: 6; } .view .stag > :nth-child(n+8) { --i: 7; }
.view .stag-1 { animation-delay: 120ms; } .view .stag-2 { animation-delay: 180ms; } .view .stag-3 { animation-delay: 240ms; } .view .stag-4 { animation-delay: 300ms; }
.view.still *, .view.still { animation: none !important; }

/* ---------- griglie, card, kpi ---------- */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } .grid.two.wide-l { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh1); min-width: 0; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.card.flat { box-shadow: none; padding: 10px 14px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; } .card-h h3 { font-size: 15px; flex: 1; }
.kpi { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh1); overflow: hidden; min-width: 0; transition: transform .2s var(--ease), box-shadow .2s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh2); }
.kpi-l { color: var(--mut); font-size: 12.5px; font-weight: 600; }
.kpi b { font-size: 28px; letter-spacing: -.03em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi small { color: var(--mut); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.kpi.acc { background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 10%, var(--panel)), var(--panel) 60%); }
.kpi.warn b { color: var(--warn); }
.kpi.live b::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: 8px; vertical-align: 6px; box-shadow: 0 0 0 0 var(--ok); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
.kpi .spark { position: absolute; right: 12px; top: 14px; width: 92px; height: 30px; opacity: .95; }
.spark .l { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s .2s var(--ease) forwards; vector-effect: non-scaling-stroke; }
.spark .a { opacity: .1; animation: fade 1s .6s both; }
.view.still .spark .l, .drawer .spark .l { stroke-dashoffset: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } } @keyframes fade { from { opacity: 0; } }
.sk { position: relative; overflow: hidden; min-height: 104px; }
.sk.tall { min-height: 280px; }
.sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--line) 70%, transparent) 50%, transparent 80%); animation: shim 1.3s infinite; }
@keyframes shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.kpi.sk i { display: block; height: 10px; border-radius: 6px; background: var(--line2); width: 40%; } .kpi.sk i:nth-child(2) { height: 24px; width: 60%; margin: 6px 0; } .kpi.sk i:nth-child(3) { width: 75%; }
.banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; background: var(--accs); color: var(--ink); margin-bottom: 16px; }
.banner > svg { color: var(--acc); width: 22px; height: 22px; }
.banner div { display: grid; flex: 1; } .banner span { color: var(--ink2); font-size: 13px; }
.banner.warn { background: var(--warns); } .banner.warn > svg { color: var(--warn); } .banner.bad { background: var(--bads); } .banner.bad > svg { color: var(--bad); }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 10px; color: var(--mut); }
.empty b { color: var(--ink); font-size: 15px; } .empty span { max-width: 380px; } .empty .btn { margin-top: 8px; }
.empty-art { width: 120px; height: 80px; fill: none; stroke: color-mix(in srgb, var(--mut) 45%, transparent); stroke-width: 1.5; margin-bottom: 6px; }
.empty-art circle { fill: currentColor; stroke: none; opacity: .5; } .empty-art .ln { stroke: var(--acc); stroke-width: 2.2; stroke-dasharray: 120; stroke-dashoffset: 120; animation: dash 1.6s .3s var(--ease) forwards; stroke-linecap: round; stroke-linejoin: round; }
@keyframes dash { to { stroke-dashoffset: 0; } }

/* ---------- grafici ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart text { fill: var(--mut); font-size: 11px; font-family: var(--font); }
.bars .bar rect:first-child { fill: color-mix(in srgb, var(--acc) 30%, var(--panel)); transform-box: fill-box; transform-origin: 50% 100%; animation: grow .8s var(--ease) both; animation-delay: calc(var(--i) * 40ms + 100ms); transition: fill .15s; }
.bars .bar.hi rect:first-child { fill: var(--acc); }
.bars .bar:hover rect:first-child { fill: var(--acc2); }
.bars .hit { fill: transparent; }
.bars .val { font-weight: 600; fill: var(--ink2); animation: fade .4s both; animation-delay: calc(var(--i) * 40ms + 700ms); }
@keyframes grow { from { transform: scaleY(0); } }
.mix { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; }
.donut { position: relative; width: 170px; height: 170px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 5.2; }
.donut circle:not(.track) { animation: seg 1s var(--ease) both; animation-delay: calc(var(--i) * 120ms + 150ms); stroke-linecap: butt; }
.donut .track { stroke: var(--line2); }
@keyframes seg { from { stroke-dasharray: 0 100; } }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font-size: 30px; letter-spacing: -.03em; line-height: 1; } .donut-c span { color: var(--mut); font-size: 12px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .legend b { font-variant-numeric: tabular-nums; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line2); }
.plan { display: grid; gap: 3px; } .plan span { color: var(--mut); font-size: 12px; font-weight: 600; } .plan b { font-size: 19px; }
.plan i { display: block; height: 5px; border-radius: 9px; background: var(--line2); position: relative; overflow: hidden; }
.plan i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 9px; background: var(--acc); animation: wgrow 1s .3s var(--ease) both; }
.plan.p-prova i::after { background: var(--warn); } .plan.p-pro i::after { background: linear-gradient(90deg, #2b4f8f, #5a3fa8); }
@keyframes wgrow { from { width: 0; } }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; } .ring .track { stroke: var(--line2); }
.ring .v { stroke: var(--ok); stroke-linecap: round; animation: seg 1.1s .15s var(--ease) both; }
.ring.s-soon .v { stroke: var(--warn); } .ring.s-late .v, .ring.s-off .v { stroke: var(--bad); }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 26px; letter-spacing: -.03em; line-height: 1; } .ring span { font-size: 11px; color: var(--mut); }

/* ---------- liste ---------- */
.todo { list-style: none; margin: 0; padding: 0; display: grid; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); }
.todo li:first-child { border-top: 0; }
.todo li > a { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.todo li > a span { display: grid; min-width: 0; } .todo b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .todo small { color: var(--mut); font-size: 12px; }
.todo small.late { color: var(--bad); font-weight: 600; } .todo small.soon { color: var(--warn); font-weight: 600; }
.todo .calm { color: var(--ink2); } .todo .calm svg { color: var(--ok); width: 22px; height: 22px; } .todo .calm a { color: var(--acc); font-weight: 600; }
.todo .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1.5px; background: var(--line2); }
.tl li { display: flex; gap: 12px; padding: 7px 0; position: relative; animation: up .45s var(--ease) both; animation-delay: calc(var(--i) * 35ms + 150ms); }
.tl-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1.5px solid var(--line); color: var(--mut); flex: none; position: relative; }
.tl-i svg { width: 15px; height: 15px; }
.tl .t-ok .tl-i { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, var(--panel)); }
.tl .t-bad .tl-i { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad) 7%, var(--panel)); }
.tl .t-acc .tl-i { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 35%, var(--line)); background: color-mix(in srgb, var(--acc) 7%, var(--panel)); }
.tl li > div { display: grid; min-width: 0; padding-top: 1px; } .tl b { font-size: 13.5px; } .tl span { color: var(--ink2); font-size: 13px; overflow-wrap: anywhere; } .tl small { color: var(--mut); font-size: 12px; } .tl small a { color: var(--acc); }

/* ---------- barra filtri ---------- */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; font-weight: 600; color: var(--ink2); transition: all .15s; }
.chip em { font-style: normal; font-size: 11.5px; color: var(--mut); font-weight: 600; }
.chip:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--mut)); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); } .chip.on em { color: color-mix(in srgb, var(--panel) 70%, transparent); }
.filter { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--mut); width: 240px; }
.filter:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--accs); }
.filter input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; color: var(--ink); }
.sec-t { margin: 28px 0 12px; font-size: 13px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- card clienti ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cc { display: grid; gap: 12px; padding: 16px 16px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh1); position: relative; overflow: hidden; transition: transform .22s var(--ease), box-shadow .22s, border-color .22s; }
.cc::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); opacity: 0; transition: opacity .2s; }
.cc:hover { transform: translateY(-3px); box-shadow: var(--sh2); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.cc:hover::before { opacity: 1; }
.cc.s-off { opacity: .72; } .cc.s-off .tile { filter: grayscale(.8); }
.cc-h { display: flex; align-items: center; gap: 12px; }
.cc-n { display: grid; min-width: 0; flex: 1; } .cc-n b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cc-n span { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-s { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.meter { height: 5px; border-radius: 9px; background: var(--line2); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w); border-radius: 9px; background: var(--ok); animation: wgrow 1s .2s var(--ease) both; }
.meter.s-soon i { background: var(--warn); } .meter.s-late i, .meter.s-off i { background: var(--bad); }
.cc-f { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line2); }
.cc-f b { margin-left: auto; font-size: 14px; font-variant-numeric: tabular-nums; } .cc-f b small { color: var(--mut); font-weight: 500; font-size: 11.5px; }
.avs { display: flex; align-items: center; } .avs .av + .av { margin-left: -8px; }
.live-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ok); }
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: ping 2s infinite; }
.cards.own .cc { background: var(--panel2); box-shadow: none; }

/* ---------- tabella utenti ---------- */
.table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh1); overflow: hidden; }
.tr { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(0, 1.2fr) 20px; gap: 14px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line2); transition: background .15s; }
.view .table.stag > .tr { animation-delay: calc(var(--i, 0) * 25ms); }
.tr:hover:not(.th) { background: var(--panel2); }
.tr.th { border-top: 0; padding: 10px 18px; color: var(--mut); font-size: 12px; font-weight: 600; background: var(--panel2); }
.tr > span { min-width: 0; }
.who { display: flex; align-items: center; gap: 11px; } .who > span:last-child { display: grid; min-width: 0; } .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who small { color: var(--mut); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .ws { display: flex; align-items: center; gap: 8px; } .tr .ws > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr > span:nth-child(3) { display: flex; gap: 5px; flex-wrap: wrap; }
.when { display: grid; font-size: 12.5px; } .when small { color: var(--mut); font-size: 11.5px; }
.chev { color: var(--mut); font-size: 20px; text-align: right; }

/* ---------- pannello laterale ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 22, .35); backdrop-filter: blur(2px); display: flex; justify-content: flex-end; }
.drawer.in { animation: fade .25s both; } .drawer.in .drawer-in { animation: slide .38s var(--ease) both; }
.drawer.out { animation: fade .2s reverse both; } .drawer.out .drawer-in { animation: slide .22s ease-in reverse both; }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-in { width: min(620px, 100%); height: 100%; background: var(--bg); box-shadow: var(--sh3); display: flex; flex-direction: column; min-height: 0; }
.dw-h { padding: 14px 22px 0; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; }
.dw-h::before { content: ''; position: absolute; inset: 0 0 auto; height: 90px; background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--acc)) 12%, transparent), transparent); pointer-events: none; }
.dw-h > .ib { position: absolute; right: 12px; top: 12px; z-index: 1; }
.dw-id { display: flex; gap: 14px; align-items: center; padding: 12px 40px 14px 0; position: relative; }
.dw-id > div { display: grid; gap: 2px; min-width: 0; } .dw-id h3 { font-size: 20px; letter-spacing: -.02em; } .dw-id > div > span { color: var(--mut); font-size: 13px; overflow-wrap: anywhere; }
.dw-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.dw-act { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; position: relative; }
.dw-act .btn .tile.xs { width: 20px; height: 20px; border: 0; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
.tabs button { border: 0; background: transparent; padding: 10px 12px 11px; font-weight: 600; font-size: 13px; color: var(--mut); position: relative; white-space: nowrap; }
.tabs button em { font-style: normal; font-size: 11px; padding: 0 5px; border-radius: 6px; background: var(--panel2); margin-left: 3px; }
.tabs button.on { color: var(--ink); } .tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--acc); animation: tabin .3s var(--ease); }
@keyframes tabin { from { transform: scaleX(.3); opacity: 0; } }
.dw-body { flex: 1; overflow: auto; padding: 20px 22px 40px; }
.dw-body > * { animation: up .4s var(--ease) both; }
.dw-body h4, .form h4 { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; }
.form h4:first-child { margin-top: 4px; }
.dw-stats { display: flex; gap: 20px; align-items: center; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
.dw-sg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; flex: 1; min-width: 0; }
.dw-sg div { display: grid; min-width: 0; } .dw-sg span { font-size: 11.5px; color: var(--mut); font-weight: 600; } .dw-sg b { font-size: 14.5px; }
.form-a { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.danger-z { margin-top: 26px; padding-top: 4px; border-top: 1px dashed var(--line); }
.dz { display: flex; align-items: center; gap: 14px; padding: 12px 0; } .dz div { display: grid; flex: 1; } .dz span { color: var(--mut); font-size: 12.5px; }
.loading-b { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--mut); }
.always { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 14px; } .always span { font-size: 12px; color: var(--mut); font-weight: 600; margin-right: 4px; }
.always em { font-style: normal; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--oks); color: var(--ok); font-weight: 600; }
.mods { display: grid; gap: 8px; }
.mod { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; animation: up .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.mod:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--mut)); }
.mod:has(.sw:checked) { border-color: color-mix(in srgb, var(--acc) 30%, var(--line)); background: color-mix(in srgb, var(--acc) 4%, var(--panel)); }
.mod-t { display: grid; flex: 1; min-width: 0; } .mod-t b { font-size: 13.5px; } .mod-t small { color: var(--mut); font-size: 12px; }
.mods.compact { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; } .mods.compact .mod { padding: 10px 12px; }
.dw-list { display: grid; gap: 6px; margin-bottom: 12px; }
.ur { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.ur:hover { border-color: var(--acc); transform: translateX(2px); }
.ur > span:nth-child(2) { display: grid; flex: 1; min-width: 0; } .ur small { color: var(--mut); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; } .pay-h div { display: grid; } .pay-h span { color: var(--mut); font-size: 12px; font-weight: 600; } .pay-h b { font-size: 24px; letter-spacing: -.02em; }
.pays { display: grid; gap: 6px; }
.pay { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.card .pay { border-color: var(--line2); }
.pay-d { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; background: var(--oks); color: var(--ok); line-height: 1; flex: none; }
.pay-d b { font-size: 17px; } .pay-d small { font-size: 9.5px; font-weight: 600; text-transform: uppercase; }
.pay > div { display: grid; flex: 1; min-width: 0; } .pay > div > b { font-size: 15px; } .pay > div > span { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pay small a { color: var(--acc); font-weight: 600; font-size: 12px; }
.pay .ib { opacity: .5; } .pay:hover .ib { opacity: 1; }
.sec-acts { display: grid; gap: 6px; }
.act { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-align: left; transition: border-color .15s, transform .15s; }
.act:hover:not(:disabled) { border-color: var(--acc); transform: translateX(2px); }
.act svg { color: var(--acc); width: 20px; height: 20px; } .act span { display: grid; } .act small { color: var(--mut); font-size: 12px; }
.act.danger svg, .act.danger b { color: var(--bad); } .act.danger:hover { border-color: var(--bad); }
.act:disabled { opacity: .5; cursor: default; }
.mini { list-style: none; margin: 0; padding: 0; } .mini li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line2); font-size: 13px; } .mini li:first-child { border: 0; } .mini small { color: var(--mut); white-space: nowrap; } .mini li.bad span { color: var(--bad); }
.sess { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.card .sess { border-color: var(--line2); }
.sess-i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--oks); color: var(--ok); flex: none; position: relative; }
.sess-i::after { content: ''; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.sess > div { display: grid; flex: 1; min-width: 0; } .sess span, .sess small { color: var(--mut); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-r { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line2); }
.set-r:first-of-type { border-top: 0; } .set-r > div:first-child { display: grid; flex: 1; min-width: 0; } .set-r small { color: var(--mut); font-size: 12.5px; overflow-wrap: anywhere; }

/* ---------- finestre ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 12, 22, .45); backdrop-filter: blur(4px); }
.modal.in { animation: fade .2s both; } .modal.in .modal-card { animation: mpop .38s var(--spring) both; }
@keyframes mpop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.modal-card { width: min(520px, 100%); max-height: calc(100dvh - 40px); background: var(--panel); border-radius: 18px; box-shadow: var(--sh3); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.modal-card.wide { width: min(760px, 100%); } .modal-card.small { width: min(440px, 100%); }
.modal-card form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-card header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 4px 22px; } .modal-card header h3 { flex: 1; font-size: 17px; }
.m-body { padding: 10px 22px 6px; overflow: auto; flex: 1; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line2); }
.ask { margin: 4px 0 14px; color: var(--ink2); line-height: 1.55; }
.cred { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 6px 0 14px; }
.cred div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 11px 14px; background: var(--panel2); align-items: center; }
.cred span { color: var(--mut); font-size: 12.5px; } .cred b { overflow-wrap: anywhere; }
.cred .pw { font-size: 17px; color: var(--acc); }
.cred-a { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.done { display: grid; place-items: center; padding: 6px 0 4px; }
.done-i { width: 58px; height: 58px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done-i circle { stroke: var(--ok); stroke-dasharray: 160; stroke-dashoffset: 160; animation: dash .7s var(--ease) forwards; }
.done-i path { stroke: var(--ok); stroke-dasharray: 40; stroke-dashoffset: 40; animation: dash .45s .55s var(--ease) forwards; }
.done.big .done-i { width: 84px; height: 84px; }
.burst { position: absolute; left: 50%; top: 32%; width: 0; height: 0; pointer-events: none; z-index: 90; }
body > .burst { position: fixed; top: 40%; }
.burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; animation: boom 1.2s var(--ease) forwards; }
@keyframes boom { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 80px)) rotate(var(--r)); opacity: 0; } }

/* procedura guidata */
.wz .m-body { padding-top: 6px; display: flex; flex-direction: column; min-height: 0; position: relative; }
.wz-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 6px; padding: 0 0 14px; position: relative; }
.wz-steps li { display: grid; justify-items: center; gap: 6px; cursor: pointer; position: relative; z-index: 1; font-size: 12px; font-weight: 600; color: var(--mut); text-align: center; }
.wz-steps li i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--panel); border: 2px solid var(--line); transition: all .3s var(--ease); }
.wz-steps li.on { color: var(--ink); } .wz-steps li.on i { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 0 5px var(--accs); transform: scale(1.06); }
.wz-steps li.done i { background: var(--acc); border-color: var(--acc); color: #fff; font-size: 0; }
.wz-steps li.done i::after { content: ''; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.wz-prog { position: absolute; left: 12.5%; right: 12.5%; top: 13px; height: 2px; background: var(--line); } .wz-prog i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .45s var(--ease); }
.wz-view { overflow: hidden auto; flex: 1; min-height: 0; margin: 0 -22px; }
.wz-track { display: flex; transition: transform .45s var(--ease); align-items: flex-start; }
.wz-p { flex: 0 0 100%; padding: 8px 22px 10px; min-width: 0; }
.wz-p h4 { font-size: 18px; margin: 4px 0 12px; letter-spacing: -.02em; }
.wz-p .muted.small { margin: -6px 0 12px; }
.secs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sec { display: grid; justify-items: start; gap: 6px; padding: 12px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--panel); text-align: left; transition: border-color .15s, transform .2s var(--ease), box-shadow .2s; animation: up .4s var(--ease) both; animation-delay: calc(var(--i) * 25ms); }
.sec:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--sh2); }
.sec.on { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 15%, transparent); }
.sec.on .tile { background: var(--c); color: #fff; animation: tilepop .4s var(--spring); }
@keyframes tilepop { 50% { transform: scale(1.15); } }
.sec b { font-size: 13.5px; } .sec small { color: var(--mut); font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pp { position: relative; cursor: pointer; } .pp input { position: absolute; opacity: 0; }
.pp span { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); transition: all .15s; }
.pp small { color: var(--mut); font-size: 12px; }
.pp input:checked + span { border-color: var(--acc); background: var(--accs); box-shadow: 0 0 0 3px var(--accs); }
.pp.p-pro input:checked + span { border-color: #5a3fa8; background: rgba(90, 63, 168, .08); box-shadow: 0 0 0 3px rgba(90, 63, 168, .12); }
.recap { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 13px; background: var(--panel2); border: 1px dashed var(--line); margin-top: 6px; }
.recap div { display: grid; } .recap small { color: var(--mut); font-size: 12.5px; }
.wz-f { display: flex; justify-content: space-between !important; }
.wz-build { position: absolute; inset: 0; background: var(--panel); display: grid; place-content: center; justify-items: center; gap: 26px; animation: fade .3s both; z-index: 2; }
.bld-art { position: relative; display: grid; place-items: center; width: 180px; height: 180px; }
.bld-art .tile { position: relative; z-index: 1; animation: tilepop 1.4s ease-in-out infinite; }
.bld-art i { position: absolute; inset: 40px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: pulse2 2.1s ease-out infinite; }
.bld-art i:nth-child(3) { animation-delay: .7s; } .bld-art i:nth-child(4) { animation-delay: 1.4s; }
@keyframes pulse2 { from { transform: scale(.7); opacity: .7; } to { transform: scale(1.5); opacity: 0; } }
.bld-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bld-steps li { display: flex; align-items: center; gap: 10px; color: var(--mut); font-weight: 500; opacity: .4; animation: stepon .4s var(--ease) forwards; animation-delay: calc(var(--i) * 900ms + 200ms); }
.bld-steps li i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.bld-steps li i::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--ok); transform: scale(0); animation: dotin .3s var(--spring) forwards; animation-delay: calc(var(--i) * 900ms + 750ms); }
@keyframes stepon { to { opacity: 1; color: var(--ink); } } @keyframes dotin { to { transform: scale(1); } }
.wz-done { text-align: center; padding: 8px 0; } .wz-done h3 { font-size: 22px; margin: 8px 0 2px; } .wz-done > p { margin: 0 0 14px; }
.wz-done .cred div { text-align: left; } .wz-done .cred-a { justify-content: center; } .wz-done > p.muted.small { text-align: center; }

/* ---------- notifiche ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--panel); font-weight: 500; box-shadow: var(--sh3); max-width: calc(100vw - 32px); }
.toast.in { animation: tin .4s var(--spring) both; } @keyframes tin { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.toast svg { width: 18px; height: 18px; } .toast.ok svg { color: #4fd6a4; } .toast.bad svg { color: #ff8fa0; }
.busy { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(8, 12, 22, .2); animation: fade .2s .15s both; }
.busy div { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 14px; background: var(--panel); box-shadow: var(--sh3); font-weight: 600; }
.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--side); transition: opacity .45s, visibility .45s; }
.splash img { border-radius: 16px; animation: mpop .6s var(--spring) both; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.splash i { width: 120px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; position: relative; }
.splash i::after { content: ''; position: absolute; inset: 0; width: 40%; background: #6fa0ea; border-radius: 3px; animation: load 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.splash.out { opacity: 0; visibility: hidden; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(8, 12, 22, .45); animation: fade .2s both; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.two.wide-l { grid-template-columns: minmax(0, 1fr); }
  .search { width: 220px; } .search:focus-within { width: 260px; }
  .tr { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.4fr) 20px; } .tr > :nth-child(4) { display: none; }
}
/* ---------- telefono ---------- */
@media (max-width: 860px) {
  body { overflow: auto; }
  .gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; position: fixed; }
  .gate-art { min-height: 300px; height: 38vh; } #orbit { width: min(115%, 440px); margin-top: -10px; }
  .gate-claim { left: 20px; right: 20px; bottom: 16px; } .gate-claim b { font-size: 20px; } .gate-claim span { font-size: 13px; }
  .gate-box { align-items: start; padding: 26px 20px calc(30px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; margin-top: -20px; position: relative; }
  .gate-logo { display: none; } .gate-card h1 { font-size: 26px; } .gate-sub { margin-bottom: 18px; }
  .app { display: block; height: auto; min-height: 100%; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 35; transform: translateX(-100%); transition: transform .32s var(--ease); padding-top: calc(18px + env(safe-area-inset-top)); }
  body.side-open .side { transform: none; box-shadow: var(--sh3); }
  .main { min-height: 100vh; }
  .top { position: sticky; top: 0; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; gap: 8px; flex-wrap: wrap; }
  .top .menu { display: inline-grid; margin-left: -6px; }
  .top-t h2 { font-size: 18px; } .top-t span { font-size: 12px; }
  .search { order: 5; width: 100%; height: 36px; } .search:focus-within { width: 100%; } .search kbd { display: none; }
  #new-client { width: 40px; padding: 0; } #new-client span { display: none; }
  .view { overflow: visible; padding: 16px 14px calc(40px + env(safe-area-inset-bottom)); }
  .grid { gap: 10px; margin-bottom: 10px; } .card { padding: 15px 14px; margin-bottom: 10px; border-radius: 13px; }
  .grid.kpis, .grid.kpis.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.kpis.three > :last-child { grid-column: span 2; }
  .kpi { padding: 13px 14px; } .kpi b { font-size: 22px; } .kpi .spark { width: 62px; height: 24px; top: 12px; right: 10px; }
  .kpi-l { font-size: 12px; padding-right: 60px; } .kpi small { white-space: normal; font-size: 11.5px; }
  .mix { grid-template-columns: 130px 1fr; gap: 14px; } .donut { width: 130px; height: 130px; } .donut-c b { font-size: 24px; }
  .bar { gap: 8px; } .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; flex: 1 1 100%; } .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; } .filter { width: auto; flex: 1; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .table { border-radius: 13px; } .tr.th { display: none; }
  .tr { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; }
  .tr .ws { grid-column: 1; padding-left: 49px; font-size: 12.5px; color: var(--mut); } .tr > span:nth-child(3) { grid-column: 1; padding-left: 49px; } .tr .when { display: none; } .tr .chev { grid-row: 1; grid-column: 2; }
  .drawer-in { width: 100%; } .dw-h { padding: calc(10px + env(safe-area-inset-top)) 16px 0; } .dw-body { padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
  .dw-id h3 { font-size: 18px; } .tile.lg, .av.lg { width: 50px; height: 50px; }
  .dw-act { overflow-x: auto; flex-wrap: nowrap; margin: 0 -16px; padding: 0 16px 12px; scrollbar-width: none; } .dw-act .btn { flex: none; }
  .dw-stats { flex-direction: column; align-items: stretch; gap: 14px; } .dw-stats .ring { align-self: center; }
  .row, .row.three { grid-template-columns: minmax(0, 1fr); }
  .row.three { grid-template-columns: 1fr 1fr; } .row.three > :first-child { grid-column: span 2; }
  .mods.compact { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 0; place-items: end stretch; }
  .modal-card, .modal-card.wide, .modal-card.small { width: 100%; max-height: calc(100dvh - 30px); border-radius: 20px 20px 0 0; }
  .modal.in .modal-card { animation: sheet .4s var(--ease) both; } @keyframes sheet { from { transform: translateY(100%); } }
  .modal-card footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-card.wz { height: calc(100dvh - 30px); }
  .secs { grid-template-columns: 1fr 1fr; } .sec small { display: none; }
  .wz-steps li span { font-size: 10.5px; }
  .cred div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cred-a .btn { flex: 1; }
  .plans { gap: 6px; }
  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* test estremo */
.st-b { margin-top: 16px; }
.st-run { display: grid; gap: 12px; }
.st-top { display: flex; align-items: baseline; gap: 12px; }
.st-top b { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st-top span { color: var(--ink2); font-variant-numeric: tabular-nums; }
.meter.st-m { height: 8px; } .meter.st-m i { background: var(--acc); animation: none; transition: width .6s var(--ease); } .meter.st-m.ok i { background: var(--ok); }
.st-parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 13px; }
.st-parts li { display: flex; justify-content: space-between; gap: 8px; color: var(--mut); padding: 3px 0; border-bottom: 1px solid var(--line2); }
.st-parts li em { font-style: normal; font-variant-numeric: tabular-nums; }
.st-parts li.on { color: var(--ink); font-weight: 600; } .st-parts li.ok { color: var(--ink2); } .st-parts li.ok em { color: var(--ok); }
.st-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@media (max-width: 560px) { .st-parts { grid-template-columns: 1fr; } }

/* ===== TEAM (agenti) ===== */
.tm-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.tm-a { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh1); cursor: pointer; font: inherit; color: inherit; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.tm-a:hover { border-color: color-mix(in srgb, var(--acc) 35%, var(--line)); }
.tm-a.on { border-color: var(--acc); box-shadow: 0 0 0 3px var(--accs); }
.tm-a.off .tm-t b { color: var(--ink2); }
.tm-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel2); color: var(--mut); }
.tm-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tm-ic.st-ok { background: var(--oks); color: var(--ok); } .tm-ic.st-warn { background: var(--warns); color: var(--warn); } .tm-ic.st-bad { background: var(--bads); color: var(--bad); }
.tm-t { display: grid; min-width: 0; } .tm-t b { font-size: 13.5px; } .tm-t small { color: var(--mut); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-dot { position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tm-dot.st-ok { background: var(--ok); } .tm-dot.st-warn { background: var(--warn); } .tm-dot.st-bad { background: var(--bad); }
.tm-head { display: flex; align-items: flex-end; gap: 12px; margin: 0 2px 12px; } .tm-head > div { flex: 1; min-width: 0; } .tm-head h3 { font-size: 17px; } .tm-head p { margin: 2px 0 0; }
.tm-when { margin: -8px 0 12px; }
.tm-v { list-style: none; margin: 0; padding: 0; display: grid; }
.tm-v li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); } .tm-v li:first-child { border-top: 0; }
.tm-v i { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--ok); }
.tm-v .st-warn i { background: var(--warn); } .tm-v .st-bad i { background: var(--bad); }
.tm-v b { font-weight: 600; font-size: 13.5px; } .tm-v small { display: block; color: var(--mut); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.tm-strip { display: flex; gap: 3px; margin-bottom: 12px; } .tm-strip i { flex: 1; max-width: 14px; height: 22px; border-radius: 3px; background: var(--ok); opacity: .85; }
.tm-strip i.st-warn { background: var(--warn); } .tm-strip i.st-bad { background: var(--bad); }
.tm-err { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
@media (max-width: 1100px) { .tm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tm-grid { grid-template-columns: 1fr 1fr; } .tm-a { padding: 10px; } }

/* ---------- Team: ufficio 3D ---------- */
.tm3d { max-width: 1000px; margin: 0 auto 18px; }
.tm3d-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9.5; min-height: 300px; border-radius: var(--r); overflow: hidden; background: color-mix(in srgb, var(--panel) 60%, var(--bg)); border: 1px solid var(--line); box-shadow: var(--sh1); }
.tm3d-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.tm3d-pill { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 1px; padding: 5px 11px 6px; background: #fff; color: #0f1626; border: 1px solid rgba(15, 22, 38, .08); border-radius: 999px; box-shadow: 0 4px 14px -4px rgba(15, 22, 38, .3); font: inherit; cursor: pointer; white-space: nowrap; will-change: transform; transition: opacity .2s, box-shadow .15s; }
.tm3d-pill b { font-size: 12.5px; } .tm3d-pill small { color: #6b7488; font-size: 11px; }
.tm3d-pill i { position: absolute; top: 6px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #c9cfdb; }
.tm3d-pill.st-ok i { background: var(--ok); } .tm3d-pill.st-warn i { background: var(--warn); } .tm3d-pill.st-bad i { background: var(--bad); }
.tm3d-pill.on { box-shadow: 0 0 0 3px var(--accs), 0 4px 14px -4px rgba(15, 22, 38, .3); }
.tm3d-all { position: absolute; right: 12px; bottom: 12px; z-index: 2; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; box-shadow: var(--sh1); }
@media (max-width: 560px) { .tm3d-wrap { aspect-ratio: 4 / 5; } .tm3d-pill small { display: none; } .tm3d-pill { padding: 4px 9px; } }

/* ---------- Team: chat con l'agente ---------- */
.tm-split { display: grid; gap: 14px; max-width: 1240px; margin: 0 auto 18px; } .tm-split .tm3d { margin: 0; max-width: none; min-width: 0; }
.tm-split.on { grid-template-columns: minmax(0, 1fr) 340px; align-items: stretch; }
.tm-chat { display: flex; flex-direction: column; padding: 0; min-height: 0; overflow: hidden; }
.tc-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); } .tc-h > div { min-width: 0; } .tc-h b { display: block; font-size: 14.5px; } .tc-h small { display: block; color: var(--mut); font-size: 12px; line-height: 1.35; }
.tc-list { flex: 1; min-height: 160px; max-height: 420px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tc-m { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.tc-m.u { align-self: flex-end; background: var(--acc); border-color: var(--acc); color: #fff; border-radius: 14px; border-bottom-right-radius: 4px; }
.tc-m.e { background: var(--bads); border-color: transparent; color: var(--bad); font-size: 12.5px; }
.tc-m.typ { display: flex; gap: 4px; align-items: center; width: 52px; } .tc-m.typ i { width: 6px; height: 6px; border-radius: 50%; background: var(--mut); animation: tcDot 1s ease-in-out infinite; } .tc-m.typ i:nth-child(2) { animation-delay: .15s; } .tc-m.typ i:nth-child(3) { animation-delay: .3s; }
@keyframes tcDot { 50% { transform: translateY(-4px); opacity: .5; } }
.tc-q { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; } .tc-q button { border: 1px solid var(--line); background: var(--panel); color: var(--ink2); border-radius: 999px; padding: 5px 11px; font: 500 12px var(--font); cursor: pointer; } .tc-q button:hover { border-color: var(--acc); color: var(--acc); }
.tc-f { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); } .tc-f input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); padding: 0 12px; font: inherit; } .tc-f input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--accs); }
@media (prefers-reduced-motion: reduce) { .tc-m.typ i { animation: none; } }
@media (max-width: 900px) { .tm-split.on { grid-template-columns: 1fr; } }
.tm-split.on .tm3d { display: flex; } .tm-split.on .tm3d-wrap { aspect-ratio: auto; min-height: 440px; height: auto; flex: 1; }
@media (max-width: 900px) { .tm-split.on .tm3d-wrap { aspect-ratio: 16 / 10; min-height: 300px; flex: none; } }

.tm3d-head { position: absolute; left: 16px; top: 14px; z-index: 2; pointer-events: none; display: grid; gap: 2px; max-width: 70%; } .tm3d-head b { font-size: 20px; letter-spacing: -.01em; color: #0f1626; } .tm3d-head span { font-size: 12.5px; color: #4a5468; }
:root[data-theme="dark"] .tm3d-head b { color: #e9edf5; } :root[data-theme="dark"] .tm3d-head span { color: #aab3c6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tm3d-head b { color: #e9edf5; } :root:not([data-theme="light"]) .tm3d-head span { color: #aab3c6; } }
.tm3d-pill small { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .tm3d-head b { font-size: 16px; } .tm3d-head span { display: none; } }
.tm3d-head { background: rgba(255,255,255,.72); backdrop-filter: blur(6px); padding: 8px 12px; border-radius: 12px; }
:root[data-theme="dark"] .tm3d-head { background: rgba(17,23,37,.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tm3d-head { background: rgba(17,23,37,.7); } }
