:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e2da;
  --accent: #ea580c;
  --accent-soft: #fff1e6;
  --ok: #059669;
  --err: #dc2626;
  --ricerca: #3b82f6;
  --scrittura: #f59e0b;
  --produzione: #ec4899;
  --crescita: #10b981;
  --regia: #7c3aed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,25,23,.06), 0 8px 24px rgba(28,25,23,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter", system-ui, -apple-system, sans-serif; }
a { color: inherit; }
h1, h2, h3 { font-family: "Poppins", "Inter", sans-serif; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 30px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* topbar */
.top { display: flex; align-items: center; gap: 22px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.logo { font-family: Poppins, sans-serif; font-weight: 700; font-size: 17px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: inline-block; position: relative; }
.logo i::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; }
.nav a.on, .nav a:hover { background: var(--bg); color: var(--ink); }
.top .who { font-size: 13px; color: var(--muted); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font: 600 14px Inter, sans-serif; cursor: pointer; text-decoration: none; background: var(--ink); color: #fff; }
.btn.accent { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input, textarea, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
.flash { background: var(--accent-soft); border: 1px solid #fed7aa; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.pill.ok { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.pill.err { background: #fef2f2; color: var(--err); border-color: #fecaca; }
.pill.run { background: var(--accent-soft); color: var(--accent); border-color: #fed7aa; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.stat b { display: block; font: 700 28px Poppins, sans-serif; }
.stat span { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; background: #fff; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
pre.box { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 10px; font: 13px/1.5 ui-monospace, monospace; }

/* landing */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 40px 0; }
.hero h1 { font-size: 44px; }
.price { font: 700 44px Poppins, sans-serif; }
.price small { font-size: 16px; color: var(--muted); font-weight: 500; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 32px; } }

/* =================== UFFICIO VIRTUALE =================== */
.office-layout { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - 57px); }
.office-layout > * { min-width: 0; }
.floor-wrap { overflow-x: hidden; }
@media (max-width: 1000px) { .office-layout { grid-template-columns: minmax(0, 1fr); height: auto; } .side { border-left: 0; border-top: 1px solid var(--line); } .side .pane { max-height: none; } }
.floor-wrap { position: relative; overflow: auto; background: radial-gradient(circle at 50% 40%, #fbf8f3, #efe9df); }
.floor { position: absolute; left: 0; top: 56px; width: 980px; height: 720px; transform-origin: top left; }
.room { position: absolute; border-radius: 22px; background: #fffdf9; box-shadow: inset 0 0 0 2px #ebe4d8, 0 10px 30px rgba(120,90,50,.08); }
.room .label { position: absolute; top: 12px; left: 16px; font: 600 12px Poppins, sans-serif; text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; }
.room .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.room.regia { background: #fbf7ff; box-shadow: inset 0 0 0 2px #e9dcff, 0 10px 30px rgba(90,50,160,.08); }
.plant { position: absolute; width: 34px; height: 34px; }
.rug { position: absolute; border-radius: 50%; border: 3px dashed #eadfcf; }

.desk { position: absolute; width: 120px; height: 120px; cursor: pointer; }
.desk .table { position: absolute; left: 6px; right: 6px; top: 46px; height: 30px; background: linear-gradient(#f3e3c7, #e6cfa8); border-radius: 6px; box-shadow: 0 6px 0 #d4b98d, 0 12px 18px rgba(0,0,0,.08); }
.desk .monitor { position: absolute; left: 34px; top: 22px; width: 52px; height: 34px; border-radius: 4px; background: #1f2937; border: 3px solid #374151; transition: background .3s, box-shadow .3s; }
.desk .monitor::after { content: ""; position: absolute; left: 20px; bottom: -9px; width: 6px; height: 6px; background: #374151; }
.desk.working .monitor { background: linear-gradient(135deg, #60a5fa, #a78bfa); box-shadow: 0 0 18px rgba(96,165,250,.7); }
.desk.done .monitor { background: linear-gradient(135deg, #34d399, #10b981); }
.desk.error .monitor { background: #ef4444; }
.desk .lines { position: absolute; left: 40px; top: 28px; width: 40px; display: none; }
.desk.working .lines { display: block; }
.desk .lines i { display: block; height: 3px; margin: 3px 0; background: rgba(255,255,255,.85); border-radius: 2px; animation: type 1.2s infinite; }
.desk .lines i:nth-child(2) { width: 70%; animation-delay: .2s; }
.desk .lines i:nth-child(3) { width: 45%; animation-delay: .4s; }
@keyframes type { 0% { transform: scaleX(.2); transform-origin: left; } 60%,100% { transform: scaleX(1); transform-origin: left; } }
.person { position: absolute; left: 38px; top: 70px; width: 44px; height: 50px; transition: transform .3s; }
.desk.working .person { animation: bob .6s infinite alternate; }
@keyframes bob { to { transform: translateY(-3px); } }
.person .head { position: absolute; left: 10px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: #f1c9a5; box-shadow: inset 0 7px 0 var(--hair, #3f2a1d); z-index: 2; }
.person .body { position: absolute; left: 3px; top: 18px; width: 38px; height: 28px; border-radius: 16px 16px 8px 8px; background: var(--shirt, #f97316); }
.person .chair { position: absolute; left: 0; top: 26px; width: 44px; height: 26px; border-radius: 12px; background: #3f3f46; z-index: -1; }
.desk .name { position: absolute; left: 0; right: 0; top: 0; text-align: center; font: 600 12px Inter, sans-serif; }
.desk .name small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.desk .name { top: -16px; }
.desk .status-dot { position: absolute; right: 22px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: #d6d3d1; border: 2px solid #fff; }
.desk.working .status-dot { background: #f59e0b; animation: pulse 1s infinite; }
.desk.done .status-dot { background: var(--ok); }
@keyframes pulse { 50% { transform: scale(1.4); } }
.desk.selected .table { outline: 3px solid var(--accent); outline-offset: 3px; }
.bubble { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 6px 10px; border-radius: 10px; font-size: 11.5px; width: 170px; text-align: center; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 5; }
.bubble.show { opacity: 1; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.flyer { position: absolute; width: 22px; height: 16px; z-index: 6; pointer-events: none; transition: left .9s cubic-bezier(.5,0,.3,1), top .9s cubic-bezier(.5,0,.3,1), opacity .3s; }
.flyer svg { width: 22px; height: 16px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
.office-hud { position: absolute; left: 16px; top: 14px; display: flex; gap: 8px; z-index: 8; flex-wrap: wrap; }

/* pannello laterale */
.side { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side .tabs { display: flex; border-bottom: 1px solid var(--line); }
.side .tabs button { flex: 1; padding: 12px; border: 0; background: none; font: 600 13px Inter, sans-serif; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.side .tabs button.on { color: var(--ink); border-color: var(--accent); }
.side .pane { flex: 1; overflow: auto; padding: 16px; display: none; min-height: 0; }
.side .pane.on { display: block; }
.feed .ev { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.feed .av { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 11px Poppins; }
.feed .ev b { font-weight: 600; }
.feed .ev .arrow { color: var(--muted); }
.msg { background: var(--bg); padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; font-size: 14px; }
.msg.me { background: var(--ink); color: #fff; margin-left: 30px; }
.agent-card .skills li { margin: 4px 0; }
.out-json { font: 12px/1.5 ui-monospace, monospace; background: var(--bg); padding: 10px; border-radius: 10px; white-space: pre-wrap; max-height: 320px; overflow: auto; }
.result-files a { display: block; margin: 4px 0; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumbs img { height: 120px; border-radius: 8px; border: 1px solid var(--line); }
video.preview { width: 100%; max-width: 260px; border-radius: 12px; background: #000; }

.drop{border:2px dashed var(--line);border-radius:12px;padding:12px;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.drop.over{border-color:var(--accent);background:var(--accent-soft)}
#fileList{width:100%;display:flex;flex-direction:column;gap:4px}
#fileList .f{display:flex;gap:8px;align-items:center;font-size:13px;background:var(--bg);padding:6px 10px;border-radius:8px}
#fileList .f span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#fileList .f button{border:0;background:none;cursor:pointer;font-size:16px;color:var(--muted)}
