/* Analysis tabs an-deep and an-risk — js/pages/fis/deep.js, risk.js. Scoped under .fis-scope; builds on
   css/fis.css (cards, tables, pills, help box) and css/fis-data.css (fis-dt-* helpers). Colours only
   from the prototype tokens (--p-*, css/fis-theme.css). */
.fis-scope .fis-an{display:flex;flex-direction:column;gap:14px;min-width:0;}

/* status pills: the prototype's p-good / p-warn / p-bad, plus a neutral "ข้อมูล" (~1110) */
.fis-scope .fis-an-pill-good{background:var(--p-good-bg);color:var(--p-good);}
.fis-scope .fis-an-pill-warn{background:var(--p-warn-bg);color:var(--p-warn);}
.fis-scope .fis-an-pill-bad{background:var(--p-bad-bg);color:var(--p-bad);}
.fis-scope .fis-an-pill-info{background:var(--p-soft);color:var(--p-muted);}
.fis-scope .fis-an-tone-good{color:var(--p-good);}
.fis-scope .fis-an-tone-warn{color:var(--p-warn);}
.fis-scope .fis-an-tone-bad{color:var(--p-bad);}

/* an-deep */
.fis-scope .fis-an-nav{display:flex;flex-wrap:wrap;gap:8px;}
.fis-scope .fis-an-sum{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;}
.fis-scope .fis-an-per{font-size:calc(12.5px*var(--fz,1));color:var(--p-muted);margin-right:4px;}
.fis-scope .fis-an-sec{scroll-margin-top:96px;margin-top:14px;}
.fis-scope .fis-an-kpi td:first-child{width:auto;color:var(--p-ink);}
.fis-scope .fis-an-kpi .n{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;}
.fis-scope .fis-an-kpi td:last-child{white-space:nowrap;}
.fis-scope .fis-an-rule{font-size:calc(11px*var(--fz,1));line-height:1.45;color:var(--p-muted);margin-top:3px;}
.fis-scope .fis-an-need{margin-top:12px;}
.fis-scope .fis-an-need-i{display:flex;gap:8px;padding:7px 0;border-bottom:1px solid var(--p-line);font-size:calc(13px*var(--fz,1));color:var(--p-ink);line-height:1.45;}
.fis-scope .fis-an-need-i:last-child{border-bottom:0;}
.fis-scope .fis-an-need-t{font-size:calc(12.5px*var(--fz,1));font-weight:700;color:var(--p-muted);margin-bottom:4px;}

/* an-risk: overall score (prototype .health / .score) */
.fis-scope .fis-an-score{display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
.fis-scope .fis-an-score > b{font-size:calc(40px*var(--fz,1));font-weight:800;line-height:1;font-variant-numeric:tabular-nums;}
.fis-scope .fis-an-score > b small{font-size:calc(14px*var(--fz,1));font-weight:500;color:var(--p-muted);margin-left:2px;}
.fis-scope .fis-an-score > div{min-width:0;flex:1 1 220px;font-size:calc(13px*var(--fz,1));}
.fis-scope .fis-an-score-t{font-weight:700;color:var(--p-ink);}

/* key risk indicators (prototype .kri ~1088) */
.fis-scope .fis-an-kri{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;align-items:center;padding:7px 0;
  border-bottom:1px solid var(--p-line);font-size:calc(12.5px*var(--fz,1));}
.fis-scope .fis-an-kri:last-child{border-bottom:0;}
.fis-scope .fis-an-kri > span:nth-child(2){white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums;}
.fis-scope .fis-an-kri small{grid-column:1 / -1;color:var(--p-muted);font-size:calc(11px*var(--fz,1));}
.fis-scope .fis-an-bar{grid-column:1 / -1;position:relative;height:8px;border-radius:99px;margin:4px 0 1px;opacity:.85;}
.fis-scope .fis-an-bar i{position:absolute;top:-3px;width:3px;height:14px;margin-left:-1.5px;border-radius:2px;background:var(--p-ink);}

/* register / rule table */
.fis-scope .fis-an-reg{min-width:560px;}
.fis-scope .fis-an-reg td:nth-child(2){min-width:200px;white-space:normal;}
.fis-scope .fis-an-ev{min-width:160px;color:var(--p-ink);}
.fis-scope .fis-an-reg tr.sel td{background:var(--p-soft);}
.fis-scope .fis-an-rules{min-width:420px;}
.fis-scope .fis-an-rules td:nth-child(2){white-space:normal;color:var(--p-ink);}

@media (max-width:767.98px){
  .fis-scope .fis-an-score > b{font-size:calc(32px*var(--fz,1));}
  .fis-scope .fis-an-sec{scroll-margin-top:72px;}
  /* phone: the value may wrap so the indicator name keeps its width */
  .fis-scope .fis-an-kpi .n{white-space:normal;width:34%;}
  .fis-scope .fis-an-kpi td:first-child{min-width:0;}
}
