:root {
  --ink: #141414;
  --accent: #3949ab;     /* pulsanti e schede: blu indaco al posto del nero */
  --accent-l: #e8eaf6;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e4e2dd;
  --bg: #f6f5f2;
  --card: #ffffff;
  --green: #009246;
  --green-d: #007a3a;
  --green-l: #e6f4ec;
  --red: #ce2b37;
  --red-l: #fbeaeb;
  --blue: #1f5fbf;
  --violet: #6b3fb5;
  --amber: #b86e00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 16px; line-height: 1.5; min-height: 100vh; }
a { color: var(--green-d); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.3rem; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .8em; }
.boot { display: grid; place-items: center; height: 100vh; }
.boot img { width: 240px; opacity: .9; }

/* ---------- struttura */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding-bottom: calc(76px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.topbar .logo { height: 34px; }
@media (min-width: 900px) { .topbar .logo { height: 42px; } .topbar { padding: 10px 24px; } }
.topbar .back { background: none; border: 0; color: var(--ink); font-size: 1.5rem; padding: 0 6px 0 0; cursor: pointer; line-height: 1; }
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .avatar-btn { margin-left: auto; }
.page { max-width: 980px; margin: 0 auto; padding: 18px 16px 30px; }
.page.narrow { max-width: 640px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b); }
.tabbar a { flex: 1; text-align: center; padding: 8px 2px 7px; color: var(--muted); text-decoration: none; font-size: .7rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar a.on { color: var(--ink); font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; }
@media (min-width: 900px) {
  /* sul computer la stessa barra in basso del telefono, centrata */
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 14px; border: 1px solid var(--line);
    border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.08); padding-bottom: 0; }
  .tabbar a { font-size: .78rem; padding: 9px 2px 8px; }
  .main { padding-bottom: 96px; }
}

/* ---------- elementi */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #eee;
  color: var(--ink-2); white-space: nowrap; }
.pill.green { background: var(--green-l); color: var(--green-d); }
.pill.red { background: var(--red-l); color: var(--red); }
.pill.amber { background: #fdf1de; color: var(--amber); }
.pill.dark { background: var(--accent); color: #fff; }
.badge { background: var(--red); color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 700; padding: 0 6px; margin-left: auto; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 20px 0 8px; }
.section-head h2 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink-2, #333); }
.kicker { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 11px;
  padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--accent); color: #fff;
  min-height: 44px; }
.btn:hover { filter: brightness(1.15); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid #c5cae9; }
.btn.light { background: var(--accent-l); color: var(--accent); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .86rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--green-d); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.link.danger { color: var(--red); }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
label.f > span .req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.help { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.err { background: var(--red-l); color: var(--red); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: .92rem; }
.ok { background: var(--green-l); color: var(--green-d); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: .92rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }   /* vanno a capo invece di uscire dallo schermo */
.tabs button, .tabs a { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit;
  font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink); text-decoration: none; }
.tabs .on { background: var(--accent); color: #fff; border-color: var(--accent); }

#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 100; transition: .25s;
  pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- aree */
.area { position: relative; display: block; text-decoration: none; color: var(--ink); background: #fff; border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); border-left: 5px solid var(--c, var(--ink)); transition: transform .1s; }
.area:hover { transform: translateY(-1px); }
.area .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff;
  margin-bottom: 10px; }
.area .ico svg { width: 22px; height: 22px; }
.area b { display: block; font-size: 1.02rem; }
.area span { font-size: .85rem; color: var(--muted); }
.area .badge { position: absolute; top: 12px; right: 12px; }
.hero-area { border-radius: var(--radius); padding: 12px 14px; color: #fff; background: var(--c); margin-bottom: 14px; }
.hero-row { display: flex; align-items: center; gap: 12px; }
.hero-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex-shrink: 0; }
.hero-ico svg { width: 22px; height: 22px; }
.hero-txt { flex: 1; min-width: 0; }
.hero-area h1 { margin: 0; font-size: 1.15rem; }
.hero-area p { margin: 2px 0 0; opacity: .9; font-size: .84rem; line-height: 1.35; }
.hero-area > p.small { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.2); }
.hero-area .hero-btn { align-self: center; flex-shrink: 0; }

/* ---------- elenchi */
.item { display: flex; gap: 14px; text-decoration: none; color: var(--ink); background: #fff; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; align-items: flex-start; }
.item:hover { box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07); }
.item .thumb { width: 74px; height: 74px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #eee; }
.item .date { width: 58px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--ink); color: #fff;
  padding: 6px 0; line-height: 1.1; }
.item .date b { display: block; font-size: 1.4rem; }
.item .date span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.item .date.past { background: #bbb; }
.item h3 { margin: 0 0 3px; font-size: 1rem; }
.item p { margin: 0; font-size: .88rem; color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #00703a; color: #fff; display: grid;
  place-items: center; font-weight: 700; flex-shrink: 0; font-size: .95rem; }
.avatar.big { width: 84px; height: 84px; font-size: 1.6rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .8rem; }
.photos { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; }
.photos img { height: 180px; border-radius: 10px; object-fit: cover; }
.photo-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.photo-edit div { position: relative; }
.photo-edit img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; }
.photo-edit button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: var(--red); color: #fff; cursor: pointer; font-weight: 700; }
.cover { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .94rem; margin: 10px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.att { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--ink); margin-bottom: 6px; background: #fff; }
.att .ext { font-size: .7rem; font-weight: 800; background: var(--accent); color: #fff; border-radius: 6px; padding: 3px 6px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table-wrap { overflow-x: auto; }

/* ---------- questionari */
.q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q .qt { font-weight: 400; white-space: pre-wrap; margin-bottom: 8px; }
.q .qt b { font-weight: 700; }
.q .opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.q .opt input[type=radio], .q .opt input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); margin-top: 2px; flex-shrink: 0; }
/* la casella di testo di "Altro" occupa tutta la riga */
.q .opt .other-wrap { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q .opt input[type=text] { flex: 1; min-width: 180px; width: auto; height: auto; margin: 0; }
.qsection { background: var(--green-l); color: var(--ink); border-left: 5px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px; margin: 26px 0 8px; }
.qsection h3 { margin: 0 0 8px; color: var(--green-d); font-size: 1.1rem; }
.qsection p { margin: 0; white-space: pre-wrap; font-size: .93rem; color: var(--ink-2); line-height: 1.55; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.scale label { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; font-weight: 700; }
.scale input { display: none; }
.scale input:checked + span { color: #fff; }
.scale label:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.gridq td, .gridq th { text-align: center; padding: 6px; font-size: .86rem; }
.gridq td:first-child { text-align: left; }
.gridq input { width: 20px; height: 20px; accent-color: var(--green); }
.bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: .88rem; }
.bar .lbl { width: 42%; flex-shrink: 0; }
.bar .track { flex: 1; background: #eee; border-radius: 6px; height: 22px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--green); border-radius: 6px; min-width: 2px; }
.bar .n { width: 64px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.answers { max-height: 320px; overflow-y: auto; }
.answers div { padding: 8px 10px; background: var(--bg); border-radius: 8px; margin-bottom: 6px; font-size: .9rem; white-space: pre-wrap; }
.qedit { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.qedit.sec { background: #f1f1ef; }
.qedit .tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.progress { height: 6px; background: #e8e8e5; border-radius: 4px; overflow: hidden; margin: 10px 0 0; }
.progress > div { height: 100%; background: var(--green); }

/* ---------- Tec Lab */
.ask { display: flex; gap: 8px; }
.ask textarea { min-height: 52px; height: 52px; }
.answer { font-size: 1rem; white-space: pre-wrap; }
.answer sup, .cite { color: var(--blue); font-weight: 700; }
.source { border-left: 3px solid var(--blue); padding: 6px 12px; margin: 8px 0; background: #f3f6fc; border-radius: 0 8px 8px 0; font-size: .88rem; }
.source b { display: block; font-size: .82rem; }

/* ---------- AI Lab */
.prompt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; background: #f3f0fa; border-radius: 10px;
  padding: 12px; white-space: pre-wrap; margin: 8px 0; }
.ai-out { background: #faf9fd; border: 1px solid #e3dcf2; border-radius: 10px; padding: 12px; white-space: pre-wrap; margin-top: 10px; }

/* ---------- pubblico */
/* pagina pubblica: chiara, con il tricolore come filo sottile */
.pub-top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.pub-top .in { max-width: 1060px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.pub-top .logo { height: 36px; }
.hero { position: relative; background: linear-gradient(135deg, #e9f6ee 0%, #f7fbf8 55%, #fdf0f1 100%); color: var(--ink); padding: 26px 16px 24px; }
.hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--green) 0 33.3%, #fff 33.3% 66.6%, var(--red) 66.6% 100%); }
.hero .in { max-width: 1060px; margin: 0 auto; }
.hero .kicker { color: var(--green-d, #00703a); }
.hero h1 { font-size: 1.55rem; max-width: 640px; margin: 6px 0 10px; line-height: 1.25; }
.hero p { font-size: .98rem; max-width: 620px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.flag { height: 5px; display: flex; }
.flag i { flex: 1; } .flag i:nth-child(1) { background: var(--green); } .flag i:nth-child(2) { background: #fff; } .flag i:nth-child(3) { background: var(--red); }
.pub { max-width: 1060px; margin: 4px auto 0; padding: 0 16px 40px; }
.pub .card h2 { font-size: 1.1rem; }
.auth { max-width: 440px; margin: 30px auto; padding: 0 16px; }
.auth .logo { width: 260px; display: block; margin: 0 auto 20px; }
.install-steps li { margin-bottom: 8px; }
.install-box { border: 2px solid var(--green); }
@media (max-width: 600px) {
  .hero h1 { font-size: 1.3rem; }
  .hero p { font-size: .92rem; }
  .bar .lbl { width: 46%; }
  .item .thumb { width: 60px; height: 60px; }
}

/* ---------- Pillole di Esperienza */
.player { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; display: block; margin-top: 8px; }
.player-frame { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; margin-top: 8px; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.item .thumb.pill-ico { display: grid; place-items: center; background: #e0f2f3; color: #00838f; }
.item .thumb.pill-ico svg { width: 30px; height: 30px; }
.item img.thumb { width: 120px; height: 68px; }

/* regole del Business Network */
.rules summary { cursor: pointer; }
.rules ul { margin: 10px 0 0; padding-left: 20px; }
.rules li { margin: 4px 0; }
form .rules { box-shadow: none; background: var(--red-l); border: 0; }

/* campanella e notifiche */
.bell { margin-left: auto; position: relative; color: var(--ink); display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; flex-shrink: 0; }
.bell:hover { background: #f3f2ee; }
.bell svg { width: 24px; height: 24px; }
.bell-dot { position: absolute; top: 2px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; line-height: 1; }
.bell-dot[hidden] { display: none; }
.notif-list { padding: 0; overflow: hidden; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: #faf9f6; }
.notif .ni { width: 34px; height: 34px; border-radius: 10px; background: #f3f2ee; color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.notif .ni svg { width: 18px; height: 18px; }
.notif b { font-weight: 600; }
.notif.unread { background: #fff7f7; }
.notif.unread b { font-weight: 700; }
.notif.unread .ni { background: var(--red-l); color: var(--red); }
.notif .udot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex-shrink: 0; margin-top: 6px; }
.push-card { gap: 12px; }
/* aree più piccole nella home */
.areas-sm { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.areas-sm .area { padding: 11px 12px; }
.areas-sm .area .ico { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 6px; }
.areas-sm .area .ico svg { width: 18px; height: 18px; }
.areas-sm .area b { font-size: .9rem; }
.areas-sm .area > span:not(.badge) { font-size: .76rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.areas-sm .area .badge { top: 8px; right: 8px; }

/* calendario degli appuntamenti */
.cal { padding: 14px; }
.cal-head { margin-bottom: 10px; }
.cal-head b { font-size: 1.05rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; padding: 4px 0; }
.cal-day { background: none; border: 2px solid transparent; border-radius: 10px; min-height: 50px; padding: 5px 0 4px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; font: inherit; color: var(--muted); }
.cal-day:disabled { cursor: default; opacity: 1; }
.cal-day.has { background: #f4f3ef; color: var(--ink); font-weight: 700; cursor: pointer; }
.cal-day.has:hover { background: #ebe9e3; }
.cal-day.sel { border-color: var(--accent); }
.cal-day span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today span { background: var(--accent); color: #fff; }
.cal-day .dots { display: flex; gap: 3px; min-height: 7px; }
.cal-day .dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.cal-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; }
@media (min-width: 700px) { .cal-day { min-height: 62px; } }
.draft-box { background: #fdf1de; border-left: 5px solid var(--amber); }
.remind-row { align-items: center; gap: 8px; margin-left: 30px; }
.remind-row input { width: 80px; }

.hero-btn { background: #fff; color: var(--c); border: 0; font-weight: 700; align-self: flex-start; }
.hero-btn:hover { background: rgba(255,255,255,.88); color: var(--c); }
.cal-day.add { cursor: pointer; }
.cal-day.add:not(.has):hover { background: #f4f3ef; color: var(--ink); }
.add-day { background: #c2185b; color: #fff; margin-bottom: 12px; }

.add-cal { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.add-cal .row { margin-top: 6px; gap: 8px; }
.add-cal svg { width: 16px; height: 16px; }
@media (max-width: 600px) {
  .hero-row { flex-wrap: wrap; row-gap: 8px; }
  .hero-txt { flex: 1 1 calc(100% - 52px); }
  .hero-area .hero-btn { margin-left: 50px; }
}

/* profilo */
.profile-hero { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius); color: #fff; margin-bottom: 14px;
  background: linear-gradient(135deg, #00703a 0%, #009246 60%, #2fa866 100%); --c: #00703a; }
.profile-hero h1 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.profile-hero .ph-sub { font-size: .9rem; opacity: .95; margin-top: 2px; }
.profile-hero .ph-mail { font-size: .8rem; opacity: .8; margin-top: 2px; overflow-wrap: anywhere; }
.profile-hero .avatar.big { border: 3px solid rgba(255,255,255,.85); background: rgba(255,255,255,.2); flex-shrink: 0; }
.admin-tile { margin-bottom: 14px; }
.fold { padding: 0; overflow: hidden; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "›"; font-size: 1.5rem; color: var(--muted); transition: transform .15s; line-height: 1; }
.fold[open] > summary::after { transform: rotate(90deg); }
.fold > summary b { display: block; }
.fold > summary .small { display: block; }
.fold-ico { width: 36px; height: 36px; border-radius: 10px; background: #e7f4ec; color: #00703a; display: grid; place-items: center; flex-shrink: 0; }
.fold-ico svg { width: 20px; height: 20px; }
.fold-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.profile-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.profile-links a, .profile-links button { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #fff;
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font: inherit; font-size: .92rem; border: 0; cursor: pointer; }
.profile-links svg { width: 18px; height: 18px; color: #00703a; }
.profile-links #logout { color: var(--red); }
.profile-links #logout svg { color: var(--red); }
@media (max-width: 480px) { .profile-hero { padding: 14px; gap: 12px; } .profile-hero .avatar.big { width: 68px; height: 68px; } }
.fold-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); border-left: 4px solid #3949ab; }
.fold-link b, .fold-link .small { display: block; }
.fold-link::after { content: "›"; font-size: 1.5rem; color: var(--muted); line-height: 1; }
.draft-note { display: block; text-decoration: none; color: var(--ink); font-size: .9rem; margin-top: 8px; }

/* la mia azienda */
.company-info { display: flex; gap: 12px; align-items: flex-start; }
.co-fee { padding: 10px 12px; background: #f6f7fb; border-radius: 10px; gap: 8px; flex-wrap: wrap; }
.co-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.co-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.co-row:last-child { border-bottom: 0; }
.co-row select { width: auto; min-height: 36px; padding: 4px 8px; font-size: .86rem; }
.co-add { background: #f6f7fb; border-radius: 12px; padding: 12px; }
table.t tr.collab td { background: #fafbfe; }
table.t tr.collab td:first-child { padding-left: 26px; }

/* rinnovo della quota */
.decl { margin: 12px 0 8px; line-height: 1.45; }
.check.opt { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; align-items: center; }
.check.opt:has(input:checked) { border-color: var(--green); background: var(--green-l); }
.check.opt input { accent-color: var(--green); }
.total-box { margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: #f6f7fb; font-size: 1.05rem; }
.pay-box { border-left: 5px solid var(--green); }
.renew-done ul { margin: 6px 0 10px; padding-left: 20px; }
.renew-line { text-decoration: none; color: var(--ink); margin-top: 8px; }
.renew-line.todo { background: #fdf1de; }

@media (max-width: 600px) { h1 { font-size: 1.2rem; } .tabs button, .tabs a { font-size: .84rem; padding: 5px 11px; } }

.email-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px; background: #f6f7fb; border-radius: 10px; }
.email-line b { overflow-wrap: anywhere; }
.em-form { margin: -4px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }

/* finestre di dialogo */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(20,20,20,.45); }
.dlg-body { padding: 20px; }
.dlg-body h2 { margin-bottom: 4px; }
/* menu Azioni dell'elenco associati: una voce per riga */
table.t details .stack { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 190px; }
table.t details .stack > * + * { margin-top: 0; }

/* statistiche */
.stat-card { border-top: 4px solid var(--c); }
.stat-card h2 { margin-bottom: 10px; }
.stat-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-tile { flex: 1 1 140px; background: #f6f7fb; border-radius: 10px; padding: 10px 12px; }
.stat-tile .sv { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat-tile .sl { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.chg { font-size: .78rem; font-weight: 700; }
.chg.up { color: #00703a; } .chg.down { color: #b3261e; } .chg.flat { color: var(--muted); }
.mbars { width: 100%; height: auto; margin-top: 8px; display: block; }
.mbars .bar-axis { font-size: 12px; fill: var(--muted); }
.mbars .bar-val { font-size: 12px; fill: var(--ink); font-weight: 700; }
.mbars .grid-line { stroke: #ecebe7; stroke-width: 1; }
.mbars .base-line { stroke: #c9c7c1; stroke-width: 1; }
.mbars .bar:hover path, .mbars .bar:hover rect:not([fill="transparent"]) { opacity: .8; }
.ytab { margin-top: 6px; }
.ytab summary { cursor: pointer; color: var(--accent); }
.ytab table { margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 12px; }
.stat-sub h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stat-sub .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
/* foto e loghi: riquadro quadrato, immagine intera (niente tagli), fondo bianco */
img.avatar { border-radius: 12px; object-fit: contain; background: #fff; padding: 3px; border: 1px solid var(--line); }
img.avatar.big { border-radius: 18px; padding: 6px; }
img.avatar.sm { border-radius: 8px; padding: 2px; }
.profile-hero img.avatar.big { background: #fff; border: 3px solid rgba(255,255,255,.85); }

/* risposte proposte dal profilo */
.q.prefilled input[type=text], .q.prefilled textarea { background: #f2f8f4; border-color: #b9dcc6; }
.q.prefilled .qt::after { content: "dal tuo profilo"; margin-left: 8px; font-size: .72rem; font-weight: 600; color: #00703a; background: #e7f4ec; border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.close-box { margin-top: 16px; padding: 14px; border-radius: 12px; background: #f6f7fb; }
.close-box h3 { margin: 0 0 4px; }

/* elenco associati: le azioni vanno a capo e, su schermi stretti, ogni associato diventa una scheda */
table.t.members details .stack { min-width: 165px; }
table.t.members details .stack .link { white-space: normal; text-align: left; }
table.t.members td:last-child { width: 1%; white-space: nowrap; }
table.t.members td:first-child { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  table.t.members, table.t.members tbody, table.t.members tr, table.t.members td { display: block; width: auto; }
  table.t.members tr.head { display: none; }
  table.t.members tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.t.members td { border: 0; padding: 4px 8px; white-space: normal; }
  table.t.members td:last-child { width: auto; }
  table.t.members details .stack { padding: 8px 0 4px 4px; min-width: 0; }
}

/* tasto Modifica in alto nella scheda */
.edit-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.edit-btn svg { width: 15px; height: 15px; }

/* documenti: scelta di chi li vede (amministratori) */
.att select.doc-aud { width: auto; max-width: 190px; padding: 5px 8px; font-size: .78rem; border-radius: 8px; }
@media (max-width: 600px) { .att { flex-wrap: wrap; } .att select.doc-aud { max-width: none; } }

/* documenti: filtro per tipologia */
.doc-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; }
.doc-cats .chip { display: inline-block; padding: 4px 11px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: .8rem; font-weight: 600; text-decoration: none; }
.doc-cats .chip.on { background: var(--accent-l); border-color: var(--accent); color: var(--accent); }

/* registrazione della riunione e verbale */
.consent { background: #fff8e1; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.rec-btn { background: #c62828; display: inline-flex; align-items: center; gap: 8px; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #fff; display: inline-block; flex: none; }
.rec-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fdecea; border-radius: 10px; padding: 10px 12px; }
.rec-live .rec-dot { background: #c62828; animation: recblink 1.2s infinite; }
.rec-live.paused .rec-dot { animation: none; background: #999; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; }
@keyframes recblink { 50% { opacity: .25; } }
.meet-part { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.meet-part audio { width: 100%; margin-top: 8px; height: 36px; }
.meet-tr { margin-top: 14px; }
.meet-tr summary { cursor: pointer; }
pre.transcript { white-space: pre-wrap; font: inherit; font-size: .88rem; line-height: 1.5; background: #f6f7fb; border-radius: 10px; padding: 12px; max-height: 340px; overflow: auto; }
textarea.minutes { font-size: .92rem; line-height: 1.5; }

/* quota non pagata: riquadro "La mia azienda" in rosso e pagina del blocco */
details.fee-alert { border: 2px solid var(--red); box-shadow: 0 0 0 4px var(--red-l); }
.fee-alert-msg { background: var(--red-l); color: #8e1b1b; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }
.fee-block { text-align: left; }
/* volantino QR */
.qr-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.qr-box { width: 170px; flex: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.acc-t td:first-child, .acc-t th:first-child { width: 28px; }
.acc-t input[type=checkbox] { width: 18px; height: 18px; }
input.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.flyer-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; }
.flyer { max-width: 720px; margin: 0 auto 40px; background: #fff; border-radius: 16px; padding: 40px 36px; text-align: center; box-shadow: 0 2px 16px rgba(0,0,0,.06); }
.flyer-logo { max-width: 320px; width: 70%; height: auto; }
.flyer h1 { font-size: 1.9rem; margin: 22px 0 6px; }
.flyer-msg { font-size: 1.15rem; color: #444; margin: 0 0 18px; }
.flyer-qr { width: 62%; max-width: 380px; margin: 0 auto; }
.flyer-qr svg { display: block; width: 100%; height: auto; }
.flyer-steps { text-align: left; max-width: 430px; margin: 22px auto 10px; font-size: 1.05rem; line-height: 1.7; }
.flyer-url { color: #666; font-size: .95rem; margin-top: 14px; overflow-wrap: anywhere; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .flyer { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .flyer-qr { width: 75mm; max-width: none; }
}

/* editor del modulo di rinnovo (impostazioni) */
.fee-ed { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.fee-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; }
.fee-row input[data-f=label] { flex: 1 1 260px; min-width: 0; }
.fee-row input[data-f=amount] { width: 96px; flex: none; text-align: right; }
.fee-row .fee-eur { color: var(--muted); font-weight: 600; }
.fee-row .fee-note { flex: 1 1 100%; }

/* calendario sincronizzato */
#calSync .btn { display: inline-flex; align-items: center; gap: 6px; }
#calSync .btn svg { width: 16px; height: 16px; flex: none; }

/* partner */
.partners-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.partner-logo { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.partner-logo img { width: 100%; height: 44px; object-fit: contain; }
.partner-logo > span { width: 44px; height: 44px; border-radius: 10px; background: #efe7f8; color: #6b3fb5; display: grid; place-items: center; font-weight: 800; }
.partner-logo small { font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.partner-dlg .pd-logo { max-width: 180px; max-height: 70px; object-fit: contain; display: block; margin-bottom: 10px; }
.partner-card { display: block; text-decoration: none; color: inherit; border-left: 5px solid #6b3fb5; }
.benefits { margin: 0; padding-left: 20px; line-height: 1.55; }
.benefits li { margin-bottom: 4px; }
.lvl-other { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.lvl-other summary { cursor: pointer; }
.lvl-other .btn { margin-top: 8px; }
.p-logo-prev { width: 120px; height: 60px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.p-logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
img.p-logo-sm { width: 48px; height: 32px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); flex: none; }
.fee-row.lvl textarea { flex: 1 1 100%; font-size: .88rem; }
.fee-row.lvl .lvl-perms { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.fee-row.lvl input[data-l=name] { flex: 1 1 260px; min-width: 0; width: auto; }
.fee-row.lvl input[data-l=amount] { width: 96px; flex: none; text-align: right; }
.fee-row.lvl input[data-l=materiali_month] { width: 64px; display: inline-block; padding: 5px 8px; }

.pill.promo { background: #efe7f8; color: #6b3fb5; }

/* amministrazione: pannello */
.adm-head { margin-bottom: 10px; }
.adm-head h1 { margin: 2px 0 0; }
.adm-back { font-size: .85rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.adm-todo h2 { margin: 0 0 8px; }
.adm-todo-list { display: flex; flex-direction: column; }
.adm-todo-list a { display: flex; align-items: center; gap: 8px; padding: 10px 2px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .95rem; }
.adm-todo-list a:first-child { border-top: 0; }
.adm-todo-list a b { min-width: 28px; height: 24px; padding: 0 7px; border-radius: 99px; background: #fdecea; color: #c62828; display: inline-grid; place-items: center; font-size: .85rem; }
.adm-todo-list a span { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.adm-stats { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.adm-tile { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 14px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.06); border-left: 4px solid var(--c); }
.adm-tile b { display: block; font-size: .95rem; }
.adm-tile .small { display: block; line-height: 1.35; }
.adm-ico { width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); display: grid; place-items: center; flex: none; }
.adm-ico svg { width: 20px; height: 20px; }
.adm-tile .badge { margin-left: 0; }
.adm-save { position: sticky; bottom: 76px; background: #fff; padding-top: 12px; margin-top: 16px; border-top: 1px solid var(--line); z-index: 2; }
@media (max-width: 600px) { .adm-grid { grid-template-columns: 1fr; } }

/* sondaggi */
.poll .poll-q { margin: 4px 0 10px; font-size: 1.05rem; }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: #f6f7f5; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.poll-opt:disabled { cursor: default; }
.poll-opt.sel { border-color: var(--green); background: #f1f8f3; }
.po-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 146, 70, .14); border-radius: 0; transition: width .3s; }
.po-check { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9aa0a6; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; flex: none; }
.po-check.sq { border-radius: 5px; }
.poll-opt.sel .po-check { background: var(--green); border-color: var(--green); }
.po-txt { position: relative; flex: 1; }
.po-n { position: relative; font-size: .82rem; font-weight: 700; color: #3c4043; white-space: nowrap; }
.po-names { margin: -2px 0 4px 42px; }
.poll-meta { margin-top: 8px; }
.draft-poll { border: 1.5px dashed #e0b85c; }
.po-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.po-edit input { flex: 1; }

/* invita un collega */
.inv-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-btns .btn svg { width: 17px; height: 17px; vertical-align: -3px; margin-right: 2px; }
.inv-wa { background: #1faa53; color: #fff; }
.inv-wa:hover { background: #178a43; color: #fff; }
.inv-qr-card { display: flex; gap: 18px; align-items: center; }
.inv-qr { width: 150px; flex-shrink: 0; }
.inv-qr svg { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--line); }
@media (max-width: 560px) { .inv-qr-card { flex-direction: column; align-items: stretch; text-align: center; } .inv-qr { width: 190px; margin: 0 auto; } }
.inv-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.inv-row:last-child { border-bottom: 0; }
.qr-full { border: 0; padding: 24px 20px; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.qr-full:not([open]) { display: none; }
.qr-full .logo { height: 40px; }
.qr-full .qf-code { width: min(80vw, 60vh, 420px); }
.qr-full .qf-code svg { width: 100%; height: auto; display: block; }
.qr-full p { margin: 4px 0; font-size: 1.05rem; }
.inv-from { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: .95rem; line-height: 1.35; }
.inv-from img, .inv-ini { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #fff; flex-shrink: 0; border: 1px solid var(--line); }
.inv-ini { display: grid; place-items: center; font-weight: 700; color: var(--green-d, #00703a); }
.inv-list { list-style: none; padding: 0; margin: 0; }
.inv-list li { position: relative; padding: 7px 0 7px 28px; border-bottom: 1px solid var(--line); line-height: 1.4; }
.inv-list li:last-child { border-bottom: 0; }
.inv-list li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 13px; height: 7px; border: solid #009246;
  border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
.inv-grid { align-items: start; }
.inv-preview { background: #fff8e1; border-bottom: 1px solid #f0dca0; }
.inv-preview .in { max-width: 1060px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
