/* Customer Success Management (Phase 25, frontend/src/pages/success): accounts' health, the survey page's results,
   the survey and playbook editors, Customer 360 ▸ Success.  Structure follows the primary colour (--accent); the
   promoter / passive / detractor split uses the status colours. */

/* health, NPS */
.cs-health{display:inline-flex;align-items:baseline;gap:6px}
.cs-score{font-weight:700;color:var(--text-primary)}
.cs-score.is-healthy{color:var(--green,#16a34a)}
.cs-score.is-watch{color:var(--amber,#d97706)}
.cs-score.is-at_risk{color:var(--red,#e11d48)}
.cs-health em{font-style:normal;font-size:11.5px;color:var(--text-muted)}
.cs-health em.is-down{color:var(--red,#e11d48)}
.cs-health em.is-up{color:var(--green,#16a34a)}
.cs-nps{font-weight:600}
.cs-nps.is-bad{color:var(--red,#e11d48)}
.cs-nps.is-good{color:var(--green,#16a34a)}
.cs-late{color:var(--red,#e11d48);font-weight:600}
.cs-why{font-size:11.5px;color:var(--text-muted)}
.cs-comment{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:420px}

/* forms: goals, steps, questions, chips */
.cs-list{display:flex;flex-direction:column;gap:6px}
.cs-list-row{display:flex;align-items:center;gap:8px}
.cs-list-row .form-input{flex:1;min-width:0}
.cs-list > .btn{align-self:flex-start}
.cs-step .cs-step-days{flex:0 0 76px}
.cs-step .cs-step-who{flex:0 0 200px}
.cs-qs{display:flex;flex-direction:column;gap:10px}
.cs-qs > .btn{align-self:flex-start}
.cs-q{border:1px solid var(--border);border-radius:10px;padding:10px;background:var(--card-bg)}
.cs-q-head{display:flex;align-items:center;gap:8px}
.cs-q-head .form-input{flex:1;min-width:0}
.cs-q-head .cs-q-type{flex:0 0 120px}
.cs-q-n{flex:none;width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:700;
  background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}
.cs-q-more{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;padding-inline-start:30px;font-size:12.5px;color:var(--text-muted)}
.cs-q-more label{display:inline-flex;align-items:center;gap:6px}
.cs-q-more input[type=number]{width:70px}
.cs-q-opts .form-input{flex:1 1 180px}
.cs-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.cs-chip{display:inline-flex;align-items:center;gap:4px;padding-block:3px;padding-inline:10px 6px;border-radius:999px;font-size:12.5px;
  background:color-mix(in srgb,var(--accent) 10%,transparent);color:var(--text-primary)}
.cs-chip button{border:0;background:none;padding:2px;cursor:pointer;color:var(--text-muted);display:inline-flex}
.cs-chip svg{width:12px;height:12px}
.cs-fixed{padding:8px 0;font-weight:600}

/* sections and the survey page */
.cs-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0}
.cs-sec{padding:14px 16px}
.cs-sec-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:10px}
.cs-sec-head b{font-size:14px;color:var(--text-primary)}
.cs-sec-head span{font-size:12px;color:var(--text-muted)}
.cs-tile{background:var(--accent)}
.cs-split{display:flex;gap:2px;height:12px;border-radius:6px;overflow:hidden;margin:4px 0 10px}
.cs-split i{display:block;min-width:4px}
.is-pro{background:var(--green,#16a34a)}
.is-pas{background:var(--amber,#d97706)}
.is-det{background:var(--red,#e11d48)}
.cs-legend{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:5px;font-size:12.5px;color:var(--text-secondary)}
.cs-legend li{display:flex;align-items:center;gap:8px}
.cs-legend li i{width:9px;height:9px;border-radius:50%;flex:none}
.cs-legend b{margin-inline-start:auto;color:var(--text-primary);font-weight:600}
.cs-trend{width:100%;border-collapse:collapse;font-size:12.5px}
.cs-trend th{text-align:start;font-weight:600;color:var(--text-muted);padding:5px 4px;border-bottom:1px solid var(--border)}
.cs-trend td{padding:5px 4px;border-bottom:1px solid var(--border-light,var(--border))}
.cs-bar{display:inline-block;width:80px;height:6px;border-radius:3px;background:var(--border);margin-inline-end:8px;vertical-align:middle;overflow:hidden}
.cs-bar i{display:block;height:100%;background:var(--accent)}
.cs-qlist{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:8px;font-size:13px}
.cs-qlist em{display:block;font-style:normal;font-size:11.5px;color:var(--text-muted)}
.cs-intro{margin:12px 0 0;font-size:12.5px;color:var(--text-muted)}
.cs-steps{margin:0;padding-inline-start:18px;font-size:12.5px}
.cs-steps em{font-style:normal;color:var(--text-muted);margin-inline-start:6px;font-size:11.5px}

/* Customer 360 ▸ Success */
.cs-x3{display:flex;flex-direction:column;gap:14px}
.cs-x3 .cs-mv{font-size:16px}
.cs-x3-acts{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.cs-notes{margin:0;padding:10px 12px;border-radius:10px;background:color-mix(in srgb,var(--accent) 6%,transparent);font-size:13px;color:var(--text-secondary)}
.cs-rows{list-style:none;margin:0;padding:0}
.cs-rows li{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:9px 0;border-bottom:1px solid var(--border-light,var(--border))}
.cs-rows li:last-child{border-bottom:0}
.cs-rows li > div:first-child{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:13px}
.cs-rows li > div:first-child span{color:var(--text-muted);font-size:12px}
.cs-rows .cs-next{color:var(--text-secondary)}
.cs-right{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap;justify-content:flex-end}
.cs-right em{font-style:normal;font-size:11.5px;color:var(--text-muted);max-width:260px;text-align:end}
.cs-ans{font-size:16px}
.cs-plan{padding:10px 0;border-bottom:1px solid var(--border-light,var(--border))}
.cs-plan:last-child{border-bottom:0}
.cs-plan-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cs-plan-head > span{font-size:12px;color:var(--text-muted)}
.cs-plan-acts{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px}
.cs-goals,.cs-tasks{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13px}
.cs-goals label{display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.cs-goals .is-done,.cs-tasks .is-done{text-decoration:line-through;color:var(--text-muted)}
.cs-tasks li{display:flex;align-items:center;gap:6px;color:var(--text-secondary)}
.cs-tasks svg{width:13px;height:13px;color:var(--text-muted)}
.cs-tasks em{font-style:normal;font-size:11.5px;color:var(--text-muted);margin-inline-start:auto}

@media (max-width:900px){
  .cs-cols{grid-template-columns:minmax(0,1fr)}
  .cs-step .cs-step-who{flex-basis:140px}
}
@media (max-width:600px){
  .cs-list-row.cs-step{flex-wrap:wrap}
  .cs-step .form-input:first-child{flex-basis:100%}
  .cs-x3-acts{justify-content:flex-start}
}

/* Draft With AI in a survey's questions (Customer Success at level 1) */
.cs-ai-box{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px dashed var(--border);border-radius:10px;background:var(--bg-subtle, transparent)}
.cs-ai-row{display:flex;flex-direction:column;gap:6px}
.cs-ai-acts{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cs-ai-acts > select.form-input{width:auto;min-width:0;max-width:130px}
.cs-ai-acts > .fm-note{flex:1;min-width:200px;margin:0}
.cs-ai-box .lr-ai-qs b{font-weight:600}
.cs-qs > .fm-ai{align-self:flex-start}
