/* CardioLink Salute — Mobile v3 — Light Scientific */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;0,700;1,400;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --g900:#0b3d2e; --g700:#1a5c3e; --g500:#27ae60; --g200:#bbedd4; --g100:#e8f7ee; --g50:#f2fbf5;
  --bg:#f5f5f3; --surface:#ffffff; --surface2:#fafaf8;
  --border:#e4e7e2; --border2:#d0d5cc;
  --t900:#18201a; --t700:#374237; --t500:#5c6b5c; --t400:#8a9689; --t300:#b8c2b7;
  --red-bg:#fff2f2; --red-b:#fca5a5; --red-t:#991b1b;
  --blue-bg:#eff6ff; --blue-b:#bfdbfe; --blue-t:#1e40af;
  --amber-bg:#fffbeb; --amber-b:#fde68a; --amber-t:#92400e;
  --serif:'Lora',Georgia,serif; --sans:'Inter',-apple-system,sans-serif;
  --nav:56px; --r:10px; --r2:16px; --r3:22px;
  --s1:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --s2:0 4px 16px rgba(0,0,0,.07),0 1px 4px rgba(0,0,0,.04);
  --s3:0 16px 48px rgba(0,0,0,.12),0 4px 16px rgba(0,0,0,.07);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%}
body{font-family:var(--sans);background:var(--bg);color:var(--t900);-webkit-font-smoothing:antialiased;line-height:1.5}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer}
img{max-width:100%;height:auto;display:block}
::-webkit-scrollbar{width:3px;height:3px}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:3px}

/* ── NAVBAR ── */
.cls-navbar{
  position:sticky;top:0;z-index:300;
  height:var(--nav);background:var(--surface);
  border-bottom:1px solid var(--border);box-shadow:var(--s1);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 16px;gap:12px;
}
.cls-logo{height:32px;width:auto}
.cls-navbar-actions{display:flex;align-items:center;gap:8px}
.cls-icon-btn{
  width:36px;height:36px;
  background:var(--bg);border:1px solid var(--border);
  border-radius:var(--r);color:var(--t700);
  display:flex;align-items:center;justify-content:center;
  -webkit-tap-highlight-color:transparent;transition:background .12s;
}
.cls-icon-btn:active{background:var(--g50);border-color:var(--g500)}
.cls-genia-badge{
  display:flex;align-items:center;gap:5px;
  padding:5px 12px;background:var(--g50);
  border:1px solid var(--g200);border-radius:100px;
  font-size:11px;font-weight:700;color:var(--g900);white-space:nowrap;
}
.cls-genia-badge .dot{width:6px;height:6px;background:var(--g500);border-radius:50%;animation:blink 2.2s infinite}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.35}}

/* ── SEARCH OVERLAY ── */
.cls-search-overlay{
  position:fixed;inset:0;z-index:500;
  display:none;flex-direction:column;
  background:rgba(18,24,18,.55);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.cls-search-overlay.open{display:flex;animation:overlayIn .2s ease}
@keyframes overlayIn{from{opacity:0}to{opacity:1}}

.cls-search-panel{
  background:var(--surface);
  border-radius:0 0 var(--r3) var(--r3);
  box-shadow:var(--s3);
  padding:14px 16px 0;
  animation:panelDown .24s cubic-bezier(.16,1,.3,1);
}
@keyframes panelDown{from{transform:translateY(-100%)}to{transform:translateY(0)}}

.cls-search-bar{
  display:flex;align-items:center;gap:10px;
  background:var(--bg);border:2px solid var(--border);
  border-radius:var(--r2);padding:0 14px;
  transition:border-color .18s,box-shadow .18s;
  margin-bottom:14px;
}
.cls-search-bar:focus-within{border-color:var(--g700);box-shadow:0 0 0 3px rgba(11,61,46,.1)}
.cls-search-bar input{
  flex:1;border:none;background:none;outline:none;
  padding:13px 0;font-size:16px;color:var(--t900);font-family:inherit;
}
.cls-search-bar input::placeholder{color:var(--t300)}
.cls-search-bar svg{color:var(--t400);flex-shrink:0}
.cls-search-close{background:none;border:none;font-size:24px;line-height:1;color:var(--t400);padding:2px;-webkit-tap-highlight-color:transparent}

.cls-search-tags-lbl{font-size:11px;font-weight:700;color:var(--t400);text-transform:uppercase;letter-spacing:.07em;margin-bottom:8px}
.cls-search-tags{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}
.cls-stag{
  background:var(--g50);border:1px solid var(--g200);
  border-radius:100px;padding:5px 13px;
  font-size:12px;font-weight:600;color:var(--g900);
  cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background .12s;
}
.cls-stag:active{background:var(--g100)}

.cls-sr-scroll{overflow-y:auto;max-height:56vh}
.cls-sr-hdr{font-size:11px;font-weight:700;color:var(--g700);text-transform:uppercase;letter-spacing:.07em;padding:6px 0 8px}
.cls-sr-item{
  display:flex;align-items:flex-start;gap:11px;
  padding:12px 0;border-top:1px solid var(--border);
  -webkit-tap-highlight-color:transparent;
}
.cls-sr-item:active .cls-sr-title{color:var(--g700)}
.cls-sr-ico{
  width:34px;height:34px;background:var(--g50);
  border:1px solid var(--g200);border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  font-size:15px;flex-shrink:0;margin-top:1px;
}
.cls-sr-title{font-size:15px;font-weight:600;color:var(--t900);line-height:1.3;display:block;margin-bottom:3px}
.cls-sr-title mark{background:#d1fae5;color:var(--g900);border-radius:2px;padding:0 1px;font-style:normal}
.cls-sr-abs{font-size:13px;color:var(--t500);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cls-sr-all{
  display:flex;align-items:center;justify-content:center;
  padding:13px 0 4px;border-top:1.5px solid var(--border);
  font-size:14px;font-weight:700;color:var(--g700);gap:5px;
}
.cls-sr-spinner{display:flex;align-items:center;justify-content:center;gap:8px;padding:22px;color:var(--t400);font-size:13px}
.cls-sr-spinner::before{content:'';width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--g700);border-radius:50%;animation:spin .6s linear infinite;flex-shrink:0}
@keyframes spin{to{transform:rotate(360deg)}}
.cls-sr-empty{padding:22px 0;text-align:center;color:var(--t400);font-size:14px}

/* ── BOTTOM NAV ── */
.cls-bottomnav{
  position:fixed;bottom:0;left:0;right:0;z-index:300;
  height:calc(54px + env(safe-area-inset-bottom,0px));
  padding-bottom:env(safe-area-inset-bottom,0);
  background:var(--surface);border-top:1px solid var(--border);
  box-shadow:0 -1px 8px rgba(0,0,0,.05);
  display:flex;
}
.cls-nav-btn{
  flex:1;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:3px;background:none;border:none;
  color:var(--t300);font-size:10px;font-weight:700;
  letter-spacing:.04em;text-transform:uppercase;
  -webkit-tap-highlight-color:transparent;padding-top:5px;
  transition:color .14s;
}
.cls-nav-btn.active{color:var(--g900)}
.cls-nav-btn svg{width:20px;height:20px}

/* ── PAGE ── */
.cls-page{min-height:100vh;padding-bottom:calc(54px + 24px + env(safe-area-inset-bottom,0px))}

/* ── HOME HERO ── */
.cls-hero{
  background:var(--g900);
  padding:24px 20px 28px;
}
.cls-hero-eyebrow{
  font-size:11px;font-weight:700;color:rgba(255,255,255,.45);
  text-transform:uppercase;letter-spacing:.1em;margin-bottom:10px;
}
.cls-hero h1{
  font-family:var(--serif);font-size:22px;font-weight:700;
  line-height:1.28;color:#fff;margin-bottom:10px;
}
.cls-hero p{font-size:14px;color:rgba(255,255,255,.65);line-height:1.65;margin-bottom:18px}
.cls-hero-chips{display:flex;gap:6px;flex-wrap:wrap}
.cls-hero-chip{
  background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);
  border-radius:100px;padding:4px 12px;font-size:12px;
  color:rgba(255,255,255,.8);font-weight:500;
}

/* ── TAG STRIP ── */
.cls-tags-strip{
  display:flex;gap:7px;overflow-x:auto;
  padding:12px 16px;scrollbar-width:none;
  background:var(--surface);border-bottom:1px solid var(--border);
}
.cls-tags-strip::-webkit-scrollbar{display:none}
.cls-tag-pill{
  display:inline-flex;align-items:center;white-space:nowrap;
  padding:5px 14px;border-radius:100px;font-size:12px;font-weight:600;
  border:1.5px solid var(--border2);background:var(--surface);color:var(--t500);
  -webkit-tap-highlight-color:transparent;transition:all .13s;
}
.cls-tag-pill.active{background:var(--g900);border-color:var(--g900);color:#fff}

/* ── LIST HEADER ── */
.cls-list-hdr{
  display:flex;justify-content:space-between;align-items:center;
  padding:14px 16px 10px;
  background:var(--surface);border-bottom:1px solid var(--border);
}
.cls-list-hdr-label{font-size:11px;font-weight:700;color:var(--t400);text-transform:uppercase;letter-spacing:.08em}
.cls-list-hdr-count{font-size:12px;color:var(--t300)}
.cls-active-filter{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--border);
  font-size:13px;
}
.cls-af-badge{background:var(--g50);color:var(--g900);border:1px solid var(--g200);padding:3px 10px;border-radius:100px;font-size:12px;font-weight:700}
.cls-af-clear{background:#fff0f0;border:1px solid #fca5a5;color:#b91c1c;padding:3px 9px;border-radius:100px;font-size:11px;font-weight:700;display:inline-flex;align-items:center;gap:3px}

/* ── ARTICLE CARDS ── */
.cls-card-list{display:flex;flex-direction:column}
.cls-article-card{
  display:block;background:var(--surface);
  padding:18px 16px 16px;border-bottom:1px solid var(--border);
  position:relative;-webkit-tap-highlight-color:transparent;
  animation:cardIn .3s ease both;
}
@keyframes cardIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.cls-article-card::after{content:'';position:absolute;inset:0;background:var(--g50);opacity:0;transition:opacity .1s;pointer-events:none}
.cls-article-card:active::after{opacity:1}

.cls-card-kicker{
  font-size:11px;font-weight:700;color:var(--g700);
  text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px;
  display:flex;align-items:center;gap:6px;
}
.cls-card-kicker::before{content:'';width:5px;height:5px;background:var(--g500);border-radius:50%;flex-shrink:0}
.cls-card-title{
  font-family:var(--serif);font-size:18px;font-weight:600;
  line-height:1.32;color:var(--t900);margin-bottom:8px;
}
.cls-card-abstract{
  font-size:14px;color:var(--t500);line-height:1.6;margin-bottom:12px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.cls-card-foot{display:flex;justify-content:space-between;align-items:center}
.cls-card-meta{font-size:12px;color:var(--t300);display:flex;gap:10px}
.cls-card-cta{font-size:13px;font-weight:700;color:var(--g700)}

.cls-no-results{
  background:var(--surface);text-align:center;
  padding:56px 24px;color:var(--t400);font-size:15px;
  line-height:1.6;border-bottom:1px solid var(--border);
}

/* ── PAGINATION ── */
.cls-pagination{
  display:flex;align-items:center;justify-content:center;
  gap:6px;padding:20px 16px;
  background:var(--surface);border-top:1px solid var(--border);
}
.cls-pg-btn{
  width:36px;height:36px;border-radius:8px;
  border:1.5px solid var(--border);background:var(--surface);
  color:var(--t700);font-weight:700;font-size:14px;
  display:flex;align-items:center;justify-content:center;font-family:inherit;
}
.cls-pg-btn.active{background:var(--g900);border-color:var(--g900);color:#fff}
.cls-pg-arrow{
  width:36px;height:36px;border-radius:8px;
  border:1.5px solid var(--border);background:var(--surface);
  color:var(--t700);font-size:17px;
  display:flex;align-items:center;justify-content:center;
}
.cls-pg-arrow.disabled{opacity:.3;pointer-events:none}

/* ── ARTICLE TOPBAR ── */
.cls-art-topbar{
  position:sticky;top:0;z-index:200;
  background:var(--surface);border-bottom:1px solid var(--border);
  box-shadow:var(--s1);height:50px;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 12px;gap:8px;
}
.cls-back-btn{
  width:34px;height:34px;background:var(--bg);
  border:1px solid var(--border);border-radius:8px;
  color:var(--t700);display:flex;align-items:center;justify-content:center;
  flex-shrink:0;-webkit-tap-highlight-color:transparent;cursor:pointer;
}
.cls-topbar-center{
  flex:1;font-size:13px;font-weight:500;color:var(--t500);
  text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.cls-toc-btn{
  width:34px;height:34px;background:var(--bg);
  border:1px solid var(--border);border-radius:8px;
  color:var(--t700);display:flex;align-items:center;justify-content:center;
  flex-shrink:0;-webkit-tap-highlight-color:transparent;cursor:pointer;
}

/* TOC floating dropdown */
.cls-toc-panel{
  position:fixed;top:50px;right:10px;
  width:min(295px,calc(100vw - 20px));
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r2);box-shadow:var(--s3);
  z-index:250;overflow:hidden;
  max-height:0;opacity:0;pointer-events:none;
  transition:max-height .26s ease,opacity .18s ease;
}
.cls-toc-panel.open{max-height:60vh;opacity:1;pointer-events:auto;overflow-y:auto}
.cls-toc-hdr{
  padding:11px 16px 8px;font-size:10px;font-weight:800;
  color:var(--g700);text-transform:uppercase;letter-spacing:.09em;
  background:var(--g50);border-bottom:1px solid var(--border);position:sticky;top:0;
}
.cls-toc-item{
  display:flex;align-items:center;gap:8px;
  padding:10px 16px;border-top:1px solid var(--border);
  font-size:14px;color:var(--t700);-webkit-tap-highlight-color:transparent;
}
.cls-toc-item:active{background:var(--g50);color:var(--g900)}
.cls-toc-item::before{content:'';width:4px;height:4px;background:var(--border2);border-radius:50%;flex-shrink:0}
.cls-toc-item.l3{padding-left:28px;font-size:13px;color:var(--t500)}

/* ── ARTICLE HERO ── */
.cls-art-hero{background:var(--g900);padding:22px 20px 28px}
.cls-art-cats{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.cls-art-cat{
  background:rgba(255,255,255,.14);color:rgba(255,255,255,.9);
  font-size:10px;font-weight:700;padding:3px 9px;border-radius:3px;
  letter-spacing:.05em;text-transform:uppercase;
}
.cls-art-title{
  font-family:var(--serif);font-size:22px;font-weight:700;
  line-height:1.28;color:#fff;margin-bottom:14px;
}
.cls-art-abstract{
  font-size:15px;color:rgba(255,255,255,.72);
  line-height:1.65;font-style:italic;
  border-left:3px solid rgba(255,255,255,.22);
  padding-left:14px;margin-bottom:16px;
}
.cls-art-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:rgba(255,255,255,.45)}

/* ── ARTICLE BODY ── */
.cls-art-body{background:var(--surface2);padding:22px 20px 8px}
.cls-art-body h2{
  font-family:var(--serif);font-size:20px;font-weight:700;
  color:var(--t900);margin:30px 0 12px;line-height:1.3;
  border-top:2px solid var(--g100);padding-top:22px;
}
.cls-art-body h2:first-child{margin-top:0;border-top:none;padding-top:0}
.cls-art-body h3{
  font-family:var(--serif);font-size:17px;font-weight:600;
  color:var(--t900);margin:22px 0 10px;line-height:1.35;
}
.cls-art-body p{font-size:16px;line-height:1.8;color:var(--t700);margin-bottom:16px}
.cls-art-body ul,.cls-art-body ol{padding-left:22px;margin-bottom:16px}
.cls-art-body li{font-size:16px;line-height:1.7;color:var(--t700);margin-bottom:6px}
.cls-art-body strong{color:var(--t900);font-weight:700}
.cls-art-body a{color:var(--g700);text-decoration:underline}
.cls-art-body img{width:100%;border-radius:var(--r);margin:16px 0}
.cls-art-body .box-tip{background:var(--g50);border-left:3px solid var(--g500);border-radius:0 var(--r) var(--r) 0;padding:13px 15px;margin:18px 0;font-size:14px;line-height:1.65;color:var(--t700)}
.cls-art-body .box-attention{background:var(--red-bg);border-left:3px solid var(--red-b);border-radius:0 var(--r) var(--r) 0;padding:13px 15px;margin:18px 0;font-size:14px;line-height:1.65;color:var(--red-t)}
.cls-art-body .box-info{background:var(--blue-bg);border-left:3px solid var(--blue-b);border-radius:0 var(--r) var(--r) 0;padding:13px 15px;margin:18px 0;font-size:14px;line-height:1.65;color:var(--blue-t)}

.cls-art-tags-section{border-top:1px solid var(--border);padding:16px 20px 20px;background:var(--surface2)}
.cls-art-tags-lbl{font-size:11px;font-weight:700;color:var(--t400);text-transform:uppercase;letter-spacing:.07em;margin-bottom:10px}
.cls-art-tag-link{
  display:inline-flex;align-items:center;padding:5px 12px;
  background:var(--bg);border:1px solid var(--border);border-radius:100px;
  font-size:12px;color:var(--t500);font-weight:600;margin:0 6px 6px 0;
}
.cls-art-tag-link:active{background:var(--g50);color:var(--g900)}

/* ── FONTE / DISCLAIMER / CORRELATI ── */
.cls-fonte{background:var(--surface);border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:16px 20px}
.cls-fonte-lbl{font-size:11px;font-weight:800;color:var(--t400);text-transform:uppercase;letter-spacing:.08em;margin-bottom:7px}
.cls-fonte-txt{font-size:13px;color:var(--t500);line-height:1.6}
.cls-disclaimer{background:var(--amber-bg);border-top:1px solid var(--amber-b);border-bottom:1px solid var(--amber-b);padding:14px 20px;font-size:13px;color:var(--amber-t);line-height:1.6}
.cls-orig-link{display:flex;align-items:center;justify-content:center;gap:6px;padding:13px 20px;background:var(--surface);border-bottom:1px solid var(--border);font-size:13px;font-weight:600;color:var(--g700)}
.cls-correlati{background:var(--surface);padding:20px 16px;border-top:3px solid var(--g100)}
.cls-correlati-lbl{font-size:11px;font-weight:800;color:var(--t400);text-transform:uppercase;letter-spacing:.07em;margin-bottom:14px}
.cls-cor-card{display:block;border:1px solid var(--border);border-radius:var(--r);padding:14px;margin-bottom:10px;background:var(--bg);-webkit-tap-highlight-color:transparent}
.cls-cor-card:active{background:var(--g50)}
.cls-cor-title{font-family:var(--serif);font-size:15px;font-weight:600;color:var(--t900);line-height:1.33;margin-bottom:5px}
.cls-cor-abs{font-size:13px;color:var(--t500);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:7px}
.cls-cor-cta{font-size:12px;font-weight:700;color:var(--g700)}

/* ══════════════════════════════════════
   GENIA — Continuazione dell'articolo
══════════════════════════════════════ */
.cls-genia{background:var(--surface);border-top:4px solid var(--g900)}

.cls-genia-head{
  display:flex;align-items:center;gap:12px;
  padding:20px 20px 18px;border-bottom:1px solid var(--border);
}
.cls-genia-logo-box{
  width:44px;height:44px;background:var(--g900);border-radius:12px;
  display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;
}
.cls-genia-logo-box img{width:38px;height:38px;object-fit:contain;border-radius:9px;background:#fff}
.cls-genia-logo-box .gfb{font-size:22px;color:#fff}
.cls-genia-head-copy strong{display:block;font-size:16px;font-weight:700;color:var(--t900);margin-bottom:3px}
.cls-genia-head-copy span{font-size:13px;color:var(--t500)}

/* Skeleton */
.cls-gq-skel{height:54px;border-radius:var(--r);margin-bottom:8px;
  background:linear-gradient(90deg,var(--bg) 25%,var(--border) 50%,var(--bg) 75%);
  background-size:200% 100%;animation:skel 1.5s infinite}
@keyframes skel{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* Domanda button — look "continua a leggere" */
.cls-gq-list{padding:16px 16px 8px}
.cls-gq-btn{
  width:100%;text-align:left;
  display:flex;align-items:flex-start;gap:11px;
  padding:14px 16px 14px 14px;
  background:var(--bg);border:1.5px solid var(--border);
  border-radius:var(--r);margin-bottom:8px;
  cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background .13s,border-color .13s;
  position:relative;
}
.cls-gq-btn:active,.cls-gq-btn.open{
  background:var(--g50);border-color:var(--g700);
}
.cls-gq-num{
  width:24px;height:24px;border-radius:6px;
  background:var(--g100);color:var(--g900);
  font-size:12px;font-weight:800;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;margin-top:1px;
}
.cls-gq-btn.open .cls-gq-num{background:var(--g900);color:#fff}
.cls-gq-txt{flex:1;font-size:15px;font-weight:600;color:var(--t900);line-height:1.42}
.cls-gq-arr{
  flex-shrink:0;color:var(--t300);
  font-size:18px;line-height:1;margin-top:2px;
  transition:transform .2s;
}
.cls-gq-btn.open .cls-gq-arr{transform:rotate(90deg);color:var(--g700)}

/* Risposta accordion */
.cls-gq-answer{
  display:none;
  background:var(--g50);border:1.5px solid var(--g200);border-top:none;
  border-radius:0 0 var(--r) var(--r);
  margin-top:-8px;margin-bottom:8px;
  padding:14px 16px 16px;
  animation:ansIn .2s ease;
}
.cls-gq-answer.open{display:block}
@keyframes ansIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}

.cls-gq-ans-lbl{
  display:flex;align-items:center;gap:6px;
  font-size:11px;font-weight:800;color:var(--g700);
  text-transform:uppercase;letter-spacing:.07em;
  padding-bottom:10px;margin-bottom:10px;
  border-bottom:1px solid var(--g200);
}
.cls-gq-ans-txt{font-size:15px;color:var(--t700);line-height:1.75}
.cls-gq-ans-txt strong{color:var(--t900)}
.cls-gq-ans-txt em{font-style:italic}

/* Typing dots */
.cls-gq-typing{display:flex;align-items:center;gap:5px;padding:8px 0}
.cls-gq-typing span{width:7px;height:7px;background:var(--g500);border-radius:50%;animation:tdot 1.2s infinite}
.cls-gq-typing span:nth-child(2){animation-delay:.18s}
.cls-gq-typing span:nth-child(3){animation-delay:.36s}
@keyframes tdot{0%,100%{opacity:.3;transform:scale(.8)}50%{opacity:1;transform:scale(1)}}

/* Domanda libera */
.cls-genia-free{padding:8px 16px 20px;border-top:1px solid var(--border);margin-top:4px}
.cls-genia-free-lbl{font-size:12px;font-weight:700;color:var(--t400);text-transform:uppercase;letter-spacing:.06em;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.cls-genia-inp-row{display:flex;gap:8px;align-items:flex-end;margin-bottom:6px}
.cls-genia-ta{
  flex:1;background:var(--bg);border:1.5px solid var(--border);
  border-radius:var(--r);padding:11px 13px;
  color:var(--t900);font-size:15px;font-family:inherit;
  resize:none;outline:none;min-height:46px;max-height:110px;
  line-height:1.5;transition:border-color .18s;
}
.cls-genia-ta:focus{border-color:var(--g700);box-shadow:0 0 0 2px rgba(11,61,46,.08)}
.cls-genia-ta::placeholder{color:var(--t300)}
.cls-genia-send{
  width:46px;height:46px;background:var(--g900);
  border:none;border-radius:var(--r);color:#fff;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:opacity .13s;
}
.cls-genia-send:disabled{opacity:.35;cursor:default}
.cls-genia-disc{font-size:12px;color:var(--t300);text-align:center;padding:4px 0 6px;line-height:1.5}

/* Risposte domanda libera */
.cls-genia-fq{
  background:var(--bg);border:1px solid var(--border);border-radius:var(--r);
  padding:10px 13px;margin-bottom:6px;
  font-size:14px;font-weight:600;color:var(--t700);
}
.cls-genia-fq::before{content:'Tu: ';font-weight:400;color:var(--t400);font-size:11px}
.cls-genia-fa{
  background:var(--g50);border:1px solid var(--g200);border-radius:var(--r);
  padding:13px 16px;margin-bottom:10px;
  font-size:15px;color:var(--t700);line-height:1.72;
}
.cls-genia-fa strong{color:var(--t900)}
.cls-genia-fa-lbl{font-size:11px;font-weight:800;color:var(--g700);text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;padding-bottom:7px;border-bottom:1px solid var(--g200);display:flex;align-items:center;gap:5px}

.hidden{display:none!important}

/* ════════════════════════════════════════
   GENIA CHAT — stile conversazione
════════════════════════════════════════ */

/* Domande suggerite iniziali */
.cls-genia-suggestions {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.cls-genia-sugg-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--t400);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}
.cls-genia-sugg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cls-sugg-chip {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: 100px;
  padding: 9px 16px 9px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--t700);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .13s, border-color .13s, color .13s;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}
.cls-sugg-chip::before {
  content: '?';
  width: 22px; height: 22px;
  background: var(--g100);
  color: var(--g900);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cls-sugg-chip:active {
  background: var(--g50);
  border-color: var(--g700);
  color: var(--g900);
}

/* Area messaggi chat */
.cls-chat-area {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Riga messaggio */
.cls-cb-row { display: flex; gap: 0; }
.cls-cb-row-user { justify-content: flex-end; }
.cls-cb-row-ai   { justify-content: flex-start; align-items: flex-start; gap: 10px; }

/* Bolla utente */
.cls-cb-user {
  background: var(--g900);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  padding: 11px 16px;
  font-size: 15px;
  line-height: 1.55;
  max-width: 82%;
  word-break: break-word;
  animation: bubbleIn .18s ease;
}
@keyframes bubbleIn { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:scale(1)} }

/* Avatar genIA */
.cls-cb-avatar {
  width: 30px; height: 30px;
  background: var(--g900);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 20px; /* allinea sotto il nome */
  font-size: 14px;
  color: #fff;
  font-weight: 800;
}
.cls-cb-avatar img {
  width: 26px; height: 26px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

/* Bolla AI */
.cls-cb-ai-wrap { flex: 1; min-width: 0; }
.cls-cb-ai-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--g700);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.cls-cb-ai-bubble {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 4px 18px 18px 18px;
  padding: 13px 16px;
  animation: bubbleIn .2s ease;
}
.cls-cb-ai-txt {
  font-size: 15px;
  color: var(--t700);
  line-height: 1.75;
  word-break: break-word;
}
.cls-cb-ai-txt p { margin-bottom: 10px }
.cls-cb-ai-txt p:last-child { margin-bottom: 0 }
.cls-cb-ai-txt strong { color: var(--t900) }
.cls-cb-ai-txt em { font-style: italic }

/* Follow-up chips dopo la risposta */
.cls-cb-followups {
  margin-top: 10px;
}
.cls-cb-followup-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--t400);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 7px;
}
.cls-cb-followup-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  margin: 0 6px 7px 0;
  background: var(--g50);
  border: 1.5px solid var(--g200);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--g900);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, opacity .12s;
  line-height: 1.3;
  text-align: left;
}
.cls-cb-followup-chip::before {
  content: '↳';
  font-size: 13px;
  color: var(--g700);
  flex-shrink: 0;
}
.cls-cb-followup-chip:active { background: var(--g100) }
.cls-cb-followup-chip:disabled { opacity: .4; pointer-events: none }

/* Input chat */
.cls-chat-input-wrap {
  padding: 14px 16px 12px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  background: var(--surface);
  position: sticky;
  bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}
.cls-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.cls-chat-ta {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: 22px;
  padding: 11px 16px;
  color: var(--t900);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 46px;
  max-height: 110px;
  line-height: 1.5;
  transition: border-color .18s;
}
.cls-chat-ta:focus {
  border-color: var(--g700);
  box-shadow: 0 0 0 3px rgba(11,61,46,.08);
}
.cls-chat-ta::placeholder { color: var(--t300) }
.cls-chat-send {
  width: 46px; height: 46px;
  background: var(--g900);
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .13s, transform .13s;
}
.cls-chat-send:active { transform: scale(.92) }
.cls-chat-send:disabled { opacity: .35; cursor: default }
.cls-chat-disc {
  font-size: 11px;
  color: var(--t300);
  text-align: center;
  margin-top: 7px;
  line-height: 1.45;
}

/* Reset genIA */
.cls-genia-reset-btn {
  width: 32px; height: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--t500);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .13s, color .13s;
  margin-left: auto;
}
.cls-genia-reset-btn:active { background: var(--red-bg); color: var(--red-t); border-color: var(--red-b); }
