/* Ajuda i assistent. Fa servir els tokens d'ui.css; la CSP no admet estils en línia. */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Botó flotant */
.help-launch{position:fixed;right:24px;bottom:24px;z-index:40;display:inline-flex;align-items:center;gap:8px;height:48px;padding:0 20px 0 16px;border:0;border-radius:999px;background:var(--ink);color:var(--white);font-size:15px;font-weight:500;box-shadow:0 8px 24px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.12);transition:transform .2s var(--ease),box-shadow .2s var(--ease)}
.help-launch:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(0,0,0,.2),0 2px 4px rgba(0,0,0,.12)}
.help-launch:focus-visible,.help-panel :focus-visible{outline:2px solid var(--coral);outline-offset:2px}
.help-open .help-launch{opacity:0;pointer-events:none}

/* Panell lateral, no modal: es pot continuar treballant al costat */
.help-panel{position:fixed;top:12px;right:12px;bottom:12px;z-index:50;width:min(420px,calc(100vw - 24px));display:flex;flex-direction:column;background:var(--white);border-radius:22px;box-shadow:0 24px 64px rgba(0,0,0,.18),0 2px 8px rgba(0,0,0,.08);animation:help-in .28s var(--ease) both;overflow:hidden}
.help-panel[hidden]{display:none}
@keyframes help-in{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
.help-top{display:flex;align-items:center;gap:8px;padding:14px 14px 10px 20px;border-bottom:1px solid var(--line)}
.help-top b{flex:1;font-family:var(--display);font-size:17px;font-weight:600}
.help-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:999px;background:transparent;color:var(--ink-2)}
.help-icon:hover{background:var(--mist)}
.help-icon[hidden]{display:none}
.help-body{flex:1;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:22px;overscroll-behavior:contain}
.help-foot{display:flex;justify-content:space-between;gap:12px;padding:12px 20px;border-top:1px solid var(--line);font-size:14px}
.help-foot a{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2);text-decoration:none}
.help-foot a:hover{color:var(--ink)}
.help-foot a[hidden]{display:none}
.help-hello h2{font-size:22px;letter-spacing:-.02em}
.help-hello p{margin:6px 0 0;color:var(--muted);font-size:14px}
.help-block h3,.help-aside h3{font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--quiet);margin:0 0 8px}

/* Llista d'articles */
.help-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.help-list a{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border-radius:12px;text-decoration:none}
.help-list a:hover{background:var(--mist)}
.help-list b{font-size:15px;font-weight:600}
.help-list span{font-size:13px;color:var(--muted);line-height:1.4}

/* Conversa */
.help-thread{display:flex;flex-direction:column;gap:10px}
.help-thread:empty{display:none}
.help-msg{max-width:92%;padding:12px 14px;border-radius:18px;font-size:15px;line-height:1.5}
.help-msg p{margin:0}
.help-msg p+p,.help-msg ol{margin-top:8px}
.help-msg ol{padding-left:20px;margin-bottom:0}
.help-msg li+li{margin-top:4px}
.help-msg.me{align-self:flex-end;background:var(--ink);color:var(--white);border-bottom-right-radius:6px}
.help-msg.bot{align-self:flex-start;background:var(--mist);border-bottom-left-radius:6px;animation:up .3s var(--ease) both}
.help-detail{color:var(--ink-2)}
.help-sources{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.help-source{display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:500}
.help-chip{display:inline-flex;padding:4px 10px;border-radius:999px;background:var(--white);font-size:13px;text-decoration:none;color:var(--ink-2)}
.help-chip:hover{color:var(--ink)}
.help-rate{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;font-size:13px;color:var(--muted)}
.help-rate .btn.small{height:30px;padding:0 12px;font-size:13px;gap:5px;background:var(--white)}
.help-article .help-rate{margin-top:28px;padding-top:16px;border-top:1px solid var(--line)}
.help-article .help-rate .btn.small{background:var(--mist)}
.help-handoff{margin-top:10px;padding-top:10px;border-top:1px solid var(--line-2)}
.help-handoff p{font-size:14px;color:var(--ink-2);margin-bottom:8px}
.help-ask{display:flex;gap:8px;margin-top:12px}
.help-ask .input{flex:1;height:46px;padding:0 16px;border:1px solid var(--line-2);border-radius:999px;font:inherit;font-size:15px;background:var(--white)}
.help-ask .input:focus{outline:none;border-color:var(--ink)}
.help-ask .btn{width:46px;height:46px;padding:0;flex-shrink:0}

/* Article */
.help-article{font-size:15px;line-height:1.6;color:var(--ink-2)}
.help-article h2{font-size:21px;letter-spacing:-.02em;color:var(--ink);margin:4px 0 6px}
.help-article .lead{font-size:16px;color:var(--ink);margin:0 0 4px}
.help-article p{margin:12px 0 0}
.help-article h2+p{margin-top:6px}
.help-article p+h2,.help-article ol+h2,.help-article ul+h2,.help-article aside+h2,.help-article div+h2{margin-top:26px;font-size:17px}
.help-article .help-full h2,.help-full>h2{font-size:20px}
.help-article ol,.help-article ul{margin:10px 0 0;padding-left:22px}
.help-article li{margin-top:6px}
.help-article li.sub{list-style:circle;margin-left:22px}
.help-article ol{counter-reset:step;list-style:none;padding-left:0}
.help-article ol>li:not(.sub){counter-increment:step;position:relative;padding-left:34px}
.help-article ol>li:not(.sub)::before{content:counter(step);position:absolute;left:0;top:1px;width:24px;height:24px;border-radius:999px;background:var(--ink);color:var(--white);font-size:12px;font-weight:600;display:flex;align-items:center;justify-content:center}
.help-article b{color:var(--ink);font-weight:600}
.help-article a{color:var(--ink);text-decoration-color:var(--line-2);text-underline-offset:3px}
.help-article a:hover{text-decoration-color:var(--ink)}
.help-callout{margin:16px 0 0;padding:14px 16px;border-radius:16px;background:var(--mist);font-size:14.5px}
.help-callout.tip{background:#F1F7F2}
.help-callout.warn{background:var(--coral-bg);color:var(--coral-text)}
.help-callout.warn b,.help-callout.warn a{color:var(--coral-text)}
.help-table{overflow-x:auto;margin-top:12px;border:1px solid var(--line);border-radius:14px}
.help-table table{border-collapse:collapse;width:100%;font-size:14px}
.help-table th,.help-table td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top}
.help-table th{font-weight:600;color:var(--ink);background:var(--mist)}
.help-table tr:last-child td{border-bottom:0}
.help-table td:first-child{color:var(--ink);font-weight:500;white-space:nowrap}
.help-more{font-size:14px}

/* Manual sencer */
.help-hero{display:flex;flex-direction:column;gap:10px;max-width:720px}
.help-hero .lead{color:var(--muted);margin:0}
.help-search{display:flex;align-items:center;gap:10px;height:54px;padding:0 18px;margin-top:8px;border:1px solid var(--line-2);border-radius:999px;color:var(--muted);background:var(--white)}
.help-search:focus-within{border-color:var(--ink)}
.help-search input{flex:1;border:0;outline:0;font:inherit;font-size:16px;background:transparent;color:var(--ink)}
.help-results{margin-top:6px;padding:6px;border:1px solid var(--line);border-radius:18px}
.help-sections{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}
.help-section{padding:18px 10px 10px;border-radius:20px;background:var(--mist)}
.help-section h2{padding:0 12px 6px;font-size:17px}
.help-section .help-list a:hover{background:var(--white)}
.help-assistant{max-width:720px;padding:24px;border-radius:22px;border:1px solid var(--line)}
.help-assistant .note{margin:4px 0 14px}
.help-page-cols{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:48px;align-items:start}
.help-full{max-width:700px;font-size:16px}
.help-full .h1{margin-bottom:8px}
.help-full>h2{margin-top:32px}
.help-aside{position:sticky;top:24px;display:flex;flex-direction:column;gap:20px}
.help-aside-ask{padding:16px;border-radius:16px;background:var(--mist)}
.help-aside-ask .note{margin:0}
.help-public{max-width:1100px;margin:0 auto;padding:28px 24px 96px;display:flex;flex-direction:column;gap:32px}
.help-public-top{display:flex;align-items:center;justify-content:space-between;gap:16px}

@media (max-width:860px){.help-page-cols{grid-template-columns:1fr}.help-aside{position:static}}
@media (max-width:620px){
  .help-launch{right:16px;bottom:16px;height:46px;padding:0 16px 0 14px}
  .help-panel{top:0;right:0;bottom:0;width:100vw;border-radius:0}
  .help-public{padding:20px 16px 88px}
  .help-sections{grid-template-columns:1fr}
}
@media print{.help-launch,.help-panel{display:none}}

/* Mentre l'assistent amb IA redacta la resposta */
.help-typing{display:flex;gap:5px;padding:4px 0}
.help-typing span{width:7px;height:7px;border-radius:999px;background:var(--quiet);animation:help-dot 1s infinite ease-in-out}
.help-typing span:nth-child(2){animation-delay:.15s}.help-typing span:nth-child(3){animation-delay:.3s}
@keyframes help-dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
